From c0a31ab06c9de24d465f6f25412122587f87787b Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 11 Sep 2020 22:58:34 -0700 Subject: [PATCH] Prevented bubbled players from triggering level warps Fixes #41 --- src/game/level_update.c | 1 + src/pc/controller/controller_keyboard_debug.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/game/level_update.c b/src/game/level_update.c index c66f84f1..811d0178 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -718,6 +718,7 @@ void initiate_painting_warp(void) { s16 level_trigger_warp(struct MarioState *m, s32 warpOp) { // only allow for local player if (m != &gMarioStates[0]) { return 0; } + if (!is_player_active(m)) { return 0; } s32 val04 = TRUE; diff --git a/src/pc/controller/controller_keyboard_debug.c b/src/pc/controller/controller_keyboard_debug.c index f623b2e4..f22f2e06 100644 --- a/src/pc/controller/controller_keyboard_debug.c +++ b/src/pc/controller/controller_keyboard_debug.c @@ -7,6 +7,7 @@ static u8 warpToLevel = LEVEL_BITDW; +#define SCANCODE_0 0x0B #define SCANCODE_3 0x04 #define SCANCODE_6 0x07 #define SCANCODE_7 0x08 @@ -89,12 +90,17 @@ static void debug_warp_area() { } } +static void debug_suicide(void) { + gMarioStates[0].hurtCounter = 31; +} + void debug_keyboard_on_key_down(int scancode) { scancode = scancode; switch (scancode) { case SCANCODE_3: debug_breakpoint_here(); break; case SCANCODE_6: debug_warp_level(warpToLevel); break; case SCANCODE_7: debug_warp_area(); break; + case SCANCODE_0: debug_suicide(); break; } }