mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-31 09:20:59 +00:00
- 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:
parent
a153ebab7e
commit
6e3d414b3c
18 changed files with 26 additions and 60 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue