From fe53cdffd129618c64b231c26a54918993da2f44 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Sun, 2 Apr 2023 22:19:57 -0400 Subject: [PATCH] Fix cheats (#335) --- src/game/mario.c | 18 +++++++++--------- src/game/mario_step.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/game/mario.c b/src/game/mario.c index cf1d1b81b..71afee262 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -2006,17 +2006,17 @@ s32 execute_mario_action(UNUSED struct Object *o) { np->fadeOpacity += 2; gMarioState->fadeWarpOpacity = np->fadeOpacity << 3; } + } - if (gServerSettings.enableCheats) { - if (gCheats.godMode) { - gMarioState->health = 0x880; - gMarioState->healCounter = 0; - gMarioState->hurtCounter = 0; - } + if (gServerSettings.enableCheats) { + if (gCheats.godMode) { + gMarioState->health = 0x880; + gMarioState->healCounter = 0; + gMarioState->hurtCounter = 0; + } - if (gCheats.infiniteLives && gMarioState->numLives < 100) { - gMarioState->numLives = 100; - } + if (gCheats.infiniteLives && gMarioState->numLives < 100) { + gMarioState->numLives = 100; } } diff --git a/src/game/mario_step.c b/src/game/mario_step.c index 34cbc7cef..2fc368382 100644 --- a/src/game/mario_step.c +++ b/src/game/mario_step.c @@ -338,7 +338,7 @@ s32 perform_ground_step(struct MarioState *m) { smlua_call_event_hooks_mario_param(HOOK_BEFORE_PHYS_STEP, m); - if (gServerSettings.enableCheats && gCheats.superSpeed && m->playerIndex == 0) { + if (gServerSettings.enableCheats && gCheats.superSpeed && m->playerIndex == 0 && m->action != ACT_BUBBLED) { m->vel[0] *= SUPER_SPEED_MULTIPLIER; m->vel[2] *= SUPER_SPEED_MULTIPLIER; } @@ -689,7 +689,7 @@ s32 perform_air_step(struct MarioState *m, u32 stepArg) { smlua_call_event_hooks_mario_param(HOOK_BEFORE_PHYS_STEP, m); - if (gServerSettings.enableCheats && gCheats.superSpeed && m->playerIndex == 0) { + if (gServerSettings.enableCheats && gCheats.superSpeed && m->playerIndex == 0 && m->action != ACT_BUBBLED) { m->vel[0] *= SUPER_SPEED_MULTIPLIER; m->vel[2] *= SUPER_SPEED_MULTIPLIER; }