mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Factor conditions for locking player movement out into new P_CheckLockedMovement() function
git-svn-id: https://svn.eduke32.com/eduke32@8539 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
9e86e83da8
commit
e4add4956b
1 changed files with 9 additions and 3 deletions
|
@ -2889,6 +2889,14 @@ enddisplayweapon:
|
|||
|
||||
int32_t mouseyaxismode = -1;
|
||||
|
||||
static int P_CheckLockedMovement(int const playerNum)
|
||||
{
|
||||
auto const pPlayer = g_player[playerNum].ps;
|
||||
return (pPlayer->fist_incs || pPlayer->transporter_hold > 2 || pPlayer->hard_landing || pPlayer->access_incs > 0 || pPlayer->knee_incs > 0
|
||||
|| (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) == TRIPBOMB_WEAPON && pPlayer->kickback_pic > 1
|
||||
&& pPlayer->kickback_pic < PWEAPON(playerNum, pPlayer->curr_weapon, FireDelay)));
|
||||
}
|
||||
|
||||
void P_GetInput(int const playerNum)
|
||||
{
|
||||
auto const pPlayer = g_player[playerNum].ps;
|
||||
|
@ -5145,9 +5153,7 @@ void P_ProcessInput(int playerNum)
|
|||
}
|
||||
}
|
||||
|
||||
if (pPlayer->fist_incs || pPlayer->transporter_hold > 2 || pPlayer->hard_landing || pPlayer->access_incs > 0 ||
|
||||
pPlayer->knee_incs > 0 || (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) == TRIPBOMB_WEAPON &&
|
||||
*weaponFrame > 1 && *weaponFrame < PWEAPON(playerNum, pPlayer->curr_weapon, FireDelay)))
|
||||
if (P_CheckLockedMovement(playerNum))
|
||||
{
|
||||
velocityModifier = 0;
|
||||
pPlayer->vel.x = 0;
|
||||
|
|
Loading…
Reference in a new issue