- inputstate.cpp: Move checkCrouchToggle() from gameinput.ccp into ApplyGlobalInput() and use static bool for crouch toggling vs. game-side bool.

This commit is contained in:
Mitchell Richters 2020-11-07 18:16:16 +11:00
parent a153ebab7e
commit 6e3d414b3c
18 changed files with 26 additions and 60 deletions

View file

@ -353,31 +353,6 @@ void applylook(PlayerAngle* angle, float const avel, ESyncBits* actions, double
}
}
//---------------------------------------------------------------------------
//
// Crouch toggle functionality used within Duke/RR, Blood and Exhumed.
//
//---------------------------------------------------------------------------
void checkCrouchToggle(InputPacket* inputBuffer, bool* crouch_toggle, bool const crouchable, bool const forceoff)
{
if (buttonMap.ButtonDown(gamefunc_Toggle_Crouch) || *crouch_toggle)
{
inputBuffer->actions |= SB_CROUCH;
}
if (buttonMap.ButtonDown(gamefunc_Toggle_Crouch))
{
*crouch_toggle = !*crouch_toggle && crouchable;
if (crouchable)
buttonMap.ClearButton(gamefunc_Toggle_Crouch);
}
if (buttonMap.ButtonDown(gamefunc_Crouch) || buttonMap.ButtonDown(gamefunc_Jump) || forceoff)
*crouch_toggle = false;
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, PlayerAngle* def)
{
if (arc.BeginObject(keyname))