mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 13:21:04 +00:00
- clamp player sprite's xvel between 0 and 512 to stop it going into the negative with rapid posx/posy changes due to teleporting.
* With steroids and a controller (controllers have a slightly higher max fvel/svel than a keyboard), I could not get xvel to exceed 503. * Fixes #123.
This commit is contained in:
parent
d731bf4e57
commit
cf548e055e
1 changed files with 1 additions and 2 deletions
|
@ -2742,8 +2742,7 @@ void processinput_d(int snum)
|
|||
|
||||
playerweaponsway(p, s);
|
||||
|
||||
s->xvel =
|
||||
ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy));
|
||||
s->xvel = clamp(ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy)), 0, 512);
|
||||
if (p->on_ground) p->bobcounter += sprite[p->i].xvel >> 1;
|
||||
|
||||
backuppos(p, ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS));
|
||||
|
|
Loading…
Reference in a new issue