From 68aee1d2f2280182658c3b42fc8c82003c3f427d Mon Sep 17 00:00:00 2001 From: Catherine Reprobate Date: Sun, 14 Apr 2024 14:49:32 -0700 Subject: [PATCH 1/2] fix for rcp120 alt button behavior --- src/game/bondgun.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/bondgun.c b/src/game/bondgun.c index 67825c973..c2dbc993e 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -11781,6 +11781,19 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac g_Vars.currentplayer->hands[HAND_RIGHT].activatesecondary = true; return (extcontrols ? USETIMER_STOP : USETIMER_REPEAT); case WEAPON_RCP120: + #ifndef PLATFORM_N64 + s32 cloaked = (g_Vars.currentplayer->devicesactive & DEVICE_CLOAKRCP120) != 0; + // very special alt-button handling for RCP-120's cloaking + if (!trigpressed && extcontrols && fromdedicatedbutton) { + if (cloaked) { + g_Vars.currentplayer->devicesactive &= ~DEVICE_CLOAKRCP120; + } else { + g_Vars.currentplayer->devicesactive = (g_Vars.currentplayer->devicesactive & ~DEVICE_CLOAKRCP120) | DEVICE_CLOAKRCP120; + } + g_Vars.currentplayer->gunctrl.invertgunfunc = false; + return USETIMER_STOP; + } + #endif case WEAPON_LAPTOPGUN: case WEAPON_DRAGON: case WEAPON_REMOTEMINE: From fef8985b6b9e424f871c30c7bcc82bb0fa8e6476 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 14 May 2024 10:34:16 +0200 Subject: [PATCH 2/2] port: fix whitespace and scope in bgunConsiderToggleGunFunction --- src/game/bondgun.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/game/bondgun.c b/src/game/bondgun.c index c2dbc993e..8c99e39c1 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -11735,6 +11735,7 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac { #ifndef PLATFORM_N64 const bool extcontrols = PLAYER_EXTCFG().extcontrols; + bool docontinue; #endif switch (bgunGetWeaponNum(HAND_RIGHT)) { case WEAPON_SNIPERRIFLE: @@ -11759,7 +11760,6 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac } #ifndef PLATFORM_N64 - bool docontinue; if (extcontrols) { docontinue = (ABS(usedowntime) < 0); } else { @@ -11781,19 +11781,18 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac g_Vars.currentplayer->hands[HAND_RIGHT].activatesecondary = true; return (extcontrols ? USETIMER_STOP : USETIMER_REPEAT); case WEAPON_RCP120: - #ifndef PLATFORM_N64 - s32 cloaked = (g_Vars.currentplayer->devicesactive & DEVICE_CLOAKRCP120) != 0; +#ifndef PLATFORM_N64 // very special alt-button handling for RCP-120's cloaking if (!trigpressed && extcontrols && fromdedicatedbutton) { - if (cloaked) { + if (g_Vars.currentplayer->devicesactive & DEVICE_CLOAKRCP120) { g_Vars.currentplayer->devicesactive &= ~DEVICE_CLOAKRCP120; } else { g_Vars.currentplayer->devicesactive = (g_Vars.currentplayer->devicesactive & ~DEVICE_CLOAKRCP120) | DEVICE_CLOAKRCP120; } - g_Vars.currentplayer->gunctrl.invertgunfunc = false; + g_Vars.currentplayer->gunctrl.invertgunfunc = false; return USETIMER_STOP; } - #endif +#endif case WEAPON_LAPTOPGUN: case WEAPON_DRAGON: case WEAPON_REMOTEMINE: