mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- harden FinalizeInput()
with else blocks on each if statement after checking whether all movement is blocked.
Fixes #105.
This commit is contained in:
parent
3e8ff96e6b
commit
bbe05b0c81
1 changed files with 13 additions and 0 deletions
|
@ -1183,6 +1183,11 @@ static void FinalizeInput(int playerNum, input_t& input, bool vehicle)
|
|||
else
|
||||
loc.fvel = clamp(input.fvel, -(MAXVELMOTO / 8), MAXVELMOTO);
|
||||
}
|
||||
else
|
||||
{
|
||||
loc.fvel = input.fvel = 0;
|
||||
loc.svel = input.svel = 0;
|
||||
}
|
||||
|
||||
if (p->on_crane < 0 && p->newowner == -1)
|
||||
{
|
||||
|
@ -1192,11 +1197,19 @@ static void FinalizeInput(int playerNum, input_t& input, bool vehicle)
|
|||
p->one_eighty_count = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
loc.q16avel = input.q16avel = 0;
|
||||
}
|
||||
|
||||
if (p->newowner == -1 && p->return_to_center <= 0)
|
||||
{
|
||||
loc.q16horz = fix16_clamp(loc.q16horz + input.q16horz, F16(-MAXHORIZVEL), F16(MAXHORIZVEL));
|
||||
}
|
||||
else
|
||||
{
|
||||
loc.q16horz = input.q16horz = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue