Files
briaguyaandGarrett Cox 6da0031295 run clang format (#448)
* add linux clang format script

* first shot at powershell

* whoops

* webrequest is slow, try webclient

* just get the one file

* simplify and maybe make it work?

* whoops again

* try a different suggestion

* why is it always windows

* again

* try again

* bit of path stuff

* chmod +x

* add action to check

* fix workflow name

* run clang format
2024-05-22 09:05:05 -05:00

28 lines
955 B
C++

#include "MoonJump.h"
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
#include "variables.h"
static uint32_t 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 (CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) {
player->actor.velocity.y = 6.34375f;
}
});
}
}