Fix cheats (#335)

This commit is contained in:
Agent X 2023-04-02 22:19:57 -04:00 committed by GitHub
parent cdd077c9f8
commit fe53cdffd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -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;
}
}

View file

@ -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;
}