mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
27 lines
945 B
C++
27 lines
945 B
C++
#include <libultraship/bridge.h>
|
|
#include "2s2h/GameInteractor/GameInteractor.h"
|
|
#include "variables.h"
|
|
|
|
static HOOK_ID moonJumpOnLGameStateUpdateHookId = 0;
|
|
void RegisterMoonJumpOnL() {
|
|
if (moonJumpOnLGameStateUpdateHookId) {
|
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnGameStateUpdate>(
|
|
moonJumpOnLGameStateUpdateHookId);
|
|
moonJumpOnLGameStateUpdateHookId = 0;
|
|
}
|
|
|
|
if (CVarGetInteger("gCheats.MoonJumpOnL", 0)) {
|
|
moonJumpOnLGameStateUpdateHookId =
|
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameStateUpdate>([]() {
|
|
if (gPlayState == nullptr)
|
|
return;
|
|
|
|
Player* player = GET_PLAYER(gPlayState);
|
|
|
|
if (player != nullptr && CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) {
|
|
player->actor.velocity.y = 6.34375f;
|
|
}
|
|
});
|
|
}
|
|
}
|