blob: a41edc9b128e021c6637f557c080a966a9759dad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#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;
}
});
}
}
|