port: fix whitespace and scope in bgunConsiderToggleGunFunction

This commit is contained in:
fgsfds committed 2024-05-14 10:34:16 +02:00
1 parent fd8718f7b1
commit fef8985b6b
1 file changed
+5 -6
+5 -6
View File
@@ -11735,6 +11735,7 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac
{ {
#ifndef PLATFORM_N64 #ifndef PLATFORM_N64
const bool extcontrols = PLAYER_EXTCFG().extcontrols; const bool extcontrols = PLAYER_EXTCFG().extcontrols;
bool docontinue;
#endif #endif
switch (bgunGetWeaponNum(HAND_RIGHT)) { switch (bgunGetWeaponNum(HAND_RIGHT)) {
case WEAPON_SNIPERRIFLE: case WEAPON_SNIPERRIFLE:
@@ -11759,7 +11760,6 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac
} }
#ifndef PLATFORM_N64 #ifndef PLATFORM_N64
bool docontinue;
if (extcontrols) { if (extcontrols) {
docontinue = (ABS(usedowntime) < 0); docontinue = (ABS(usedowntime) < 0);
} else { } else {
@@ -11781,19 +11781,18 @@ s32 bgunConsiderToggleGunFunction(s32 usedowntime, bool trigpressed, bool fromac
g_Vars.currentplayer->hands[HAND_RIGHT].activatesecondary = true; g_Vars.currentplayer->hands[HAND_RIGHT].activatesecondary = true;
return (extcontrols ? USETIMER_STOP : USETIMER_REPEAT); return (extcontrols ? USETIMER_STOP : USETIMER_REPEAT);
case WEAPON_RCP120: case WEAPON_RCP120:
#ifndef PLATFORM_N64 #ifndef PLATFORM_N64
s32 cloaked = (g_Vars.currentplayer->devicesactive & DEVICE_CLOAKRCP120) != 0;
// very special alt-button handling for RCP-120's cloaking // very special alt-button handling for RCP-120's cloaking
if (!trigpressed && extcontrols && fromdedicatedbutton) { if (!trigpressed && extcontrols && fromdedicatedbutton) {
if (cloaked) { if (g_Vars.currentplayer->devicesactive & DEVICE_CLOAKRCP120) {
g_Vars.currentplayer->devicesactive &= ~DEVICE_CLOAKRCP120; g_Vars.currentplayer->devicesactive &= ~DEVICE_CLOAKRCP120;
} else { } else {
g_Vars.currentplayer->devicesactive = (g_Vars.currentplayer->devicesactive & ~DEVICE_CLOAKRCP120) | DEVICE_CLOAKRCP120; 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; return USETIMER_STOP;
} }
#endif #endif
case WEAPON_LAPTOPGUN: case WEAPON_LAPTOPGUN:
case WEAPON_DRAGON: case WEAPON_DRAGON:
case WEAPON_REMOTEMINE: case WEAPON_REMOTEMINE: