mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- fix cl_weaponsway
for Duke.
This commit is contained in:
parent
2919cdcb44
commit
d1a68421bd
4 changed files with 27 additions and 34 deletions
|
@ -250,6 +250,7 @@ void backupview(player_struct* p);
|
|||
void backupweapon(player_struct* p);
|
||||
void resetinputhelpers(player_struct* p);
|
||||
void checkhardlanding(player_struct* p);
|
||||
void playerweaponsway(player_struct* p, spritetype* s);
|
||||
|
||||
void playerAddAngle(player_struct* p, int ang);
|
||||
void playerSetAngle(player_struct* p, int ang);
|
||||
|
|
|
@ -927,6 +927,30 @@ void checkhardlanding(player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
void playerweaponsway(player_struct* p, spritetype* s)
|
||||
{
|
||||
if (cl_weaponsway)
|
||||
{
|
||||
if (s->xvel < 32 || p->on_ground == 0 || p->bobcounter == 1024)
|
||||
{
|
||||
if ((p->weapon_sway & 2047) > (1024 + 96))
|
||||
p->weapon_sway -= 96;
|
||||
else if ((p->weapon_sway & 2047) < (1024 - 96))
|
||||
p->weapon_sway += 96;
|
||||
else p->oweapon_sway = p->weapon_sway = 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->weapon_sway = p->bobcounter;
|
||||
|
||||
if ((p->bobcounter - p->oweapon_sway) > 256)
|
||||
{
|
||||
p->oweapon_sway = p->weapon_sway;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
|
|
@ -2731,23 +2731,7 @@ void processinput_d(int snum)
|
|||
if (p->on_crane >= 0)
|
||||
goto HORIZONLY;
|
||||
|
||||
if (s->xvel < 32 || p->on_ground == 0 || p->bobcounter == 1024)
|
||||
{
|
||||
if ((p->weapon_sway & 2047) > (1024 + 96))
|
||||
p->weapon_sway -= 96;
|
||||
else if ((p->weapon_sway & 2047) < (1024 - 96))
|
||||
p->weapon_sway += 96;
|
||||
else p->oweapon_sway = p->weapon_sway = 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->weapon_sway = p->bobcounter;
|
||||
|
||||
if ((p->bobcounter - p->oweapon_sway) > 256)
|
||||
{
|
||||
p->oweapon_sway = p->weapon_sway;
|
||||
}
|
||||
}
|
||||
playerweaponsway(p, s);
|
||||
|
||||
s->xvel =
|
||||
ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy));
|
||||
|
|
|
@ -3637,23 +3637,7 @@ void processinput_r(int snum)
|
|||
if (p->on_crane >= 0)
|
||||
goto HORIZONLY;
|
||||
|
||||
if (s->xvel < 32 || p->on_ground == 0 || p->bobcounter == 1024)
|
||||
{
|
||||
if ((p->weapon_sway & 2047) > (1024 + 96))
|
||||
p->weapon_sway -= 96;
|
||||
else if ((p->weapon_sway & 2047) < (1024 - 96))
|
||||
p->weapon_sway += 96;
|
||||
else p->oweapon_sway = p->weapon_sway = 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->weapon_sway = p->bobcounter;
|
||||
|
||||
if ((p->bobcounter - p->oweapon_sway) > 256)
|
||||
{
|
||||
p->oweapon_sway = p->weapon_sway;
|
||||
}
|
||||
}
|
||||
playerweaponsway(p, s);
|
||||
|
||||
s->xvel =
|
||||
ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy));
|
||||
|
|
Loading…
Reference in a new issue