From 8ec0feb49b511a053adbc3b972c70a1769685383 Mon Sep 17 00:00:00 2001 From: Catherine Reprobate Date: Sat, 26 Aug 2023 17:16:41 -0700 Subject: [PATCH] fix: grabbable --- src/game/bondbike.c | 2 +- src/game/bondgrab.c | 4 ++-- src/game/bondmove.c | 35 +++++++++++------------------------ src/game/bondwalk.c | 2 +- 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/src/game/bondbike.c b/src/game/bondbike.c index b08e91856..ce29b43f5 100644 --- a/src/game/bondbike.c +++ b/src/game/bondbike.c @@ -192,7 +192,7 @@ void bbikeHandleActivate(void) bmoveSetMode(MOVEMODE_WALK); } - // g_Vars.currentplayer->bondactivateorreload = 0; + g_Vars.currentplayer->bondactivateorreload = 0; } } diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index a7ebbbb96..cfca0b60f 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -891,9 +891,9 @@ void bgrabUpdateVertical(void) void bgrabHandleActivate(void) { if (currentPlayerTryMountHoverbike(g_Vars.currentplayer->grabbedprop)) { - // g_Vars.currentplayer->bondactivateorreload = 0; + g_Vars.currentplayer->bondactivateorreload = 0; } else { - // g_Vars.currentplayer->bondactivateorreload = 0; + g_Vars.currentplayer->bondactivateorreload = 0; bmoveSetMode(MOVEMODE_WALK); } } diff --git a/src/game/bondmove.c b/src/game/bondmove.c index db6a05ae9..3aa4f17f1 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -1328,21 +1328,21 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } - #ifdef PLATFORM_N64 // Handle B button if (allowc1buttons) { for (i = 0; i < numsamples; i++) { - if (joyGetButtonsOnSample(i, contpad1, c1allowedbuttons & B_BUTTON)) { + if (joyGetButtonsOnSample(i, contpad1, c1allowedbuttons & (B_BUTTON | BUTTON_CANCEL_USE | BUTTON_ACCEPT_USE))) { if (g_Vars.currentplayer->usedowntime >= -1) { - if (joyGetButtonsPressedOnSample(i, contpad1, shootbuttons & c1allowedbuttons) - && g_Vars.currentplayer->usedowntime >= 0 - && bgunConsiderToggleGunFunction(g_Vars.currentplayer->usedowntime, true, false, 0) != USETIMER_CONTINUE) { - g_Vars.currentplayer->usedowntime = -3; - } + // if (joyGetButtonsPressedOnSample(i, contpad1, shootbuttons & c1allowedbuttons) + // && g_Vars.currentplayer->usedowntime >= 0 + // && bgunConsiderToggleGunFunction(g_Vars.currentplayer->usedowntime, true, false, 0) != USETIMER_CONTINUE) { + // g_Vars.currentplayer->usedowntime = -3; + // } if (g_Vars.currentplayer->usedowntime >= 0) { if (g_Vars.currentplayer->usedowntime > TICKS(25)) { - s32 result = bgunConsiderToggleGunFunction(g_Vars.currentplayer->usedowntime, false, false, 0); + // s32 result = bgunConsiderToggleGunFunction(g_Vars.currentplayer->usedowntime, false, false, 0); + s32 result = USETIMER_CONTINUE; if (result == USETIMER_STOP) { g_Vars.currentplayer->usedowntime = -1; @@ -1356,9 +1356,9 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } } else { - if (g_Vars.currentplayer->usedowntime >= -2) { - bgunConsiderToggleGunFunction(g_Vars.currentplayer->usedowntime, false, false, 0); - } + // if (g_Vars.currentplayer->usedowntime >= -2) { + // bgunConsiderToggleGunFunction(g_Vars.currentplayer->usedowntime, false, false, 0); + // } } } else { // Released B @@ -1371,23 +1371,10 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } } } - #endif #ifndef PLATFORM_N64 if (allowc1buttons) { - // handle B / A: cancel_use - for (i = 0; i < numsamples; i++) { - if (joyGetButtonsOnSample(i, contpad1, c1allowedbuttons & (BUTTON_CANCEL_USE | BUTTON_ACCEPT_USE))) { - g_Vars.currentplayer->usedowntime++; - } else { - if (g_Vars.currentplayer->usedowntime > 0) { - movedata.btapcount++; - g_Vars.currentplayer->usedowntime = 0; - } - } - - } // handle L button : alt switching for (i = 0; i< numsamples; i++) { if (joyGetButtonsOnSample(i, contpad1, c1allowedbuttons & BUTTON_ALTMODE)) { diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index b364cfe4d..45120d8b3 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -1280,7 +1280,7 @@ void bwalkUpdatePrevPos(void) void bwalkHandleActivate(void) { if (g_Vars.currentplayer->walkinitmove) { - // g_Vars.currentplayer->bondactivateorreload = 0; + g_Vars.currentplayer->bondactivateorreload = 0; } }