mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
Improve weapon switching:
1. If you switch away from a weapon and switch to a third when the gun is still going down, continue lowering the first weapon instead of immediately raising the third. 2. If you switch away from a weapon and switch back to it before it lowers completely, raise it from its current position instead of going all the way to the bottom. git-svn-id: https://svn.eduke32.com/eduke32@4915 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
49ba033faa
commit
53306244f0
1 changed files with 11 additions and 3 deletions
|
@ -3095,15 +3095,23 @@ static void P_ChangeWeapon(DukePlayer_t *p, int32_t weapon)
|
|||
if (i != -2)
|
||||
p->curr_weapon = weapon;
|
||||
|
||||
p->last_weapon = curr_weapon;
|
||||
|
||||
p->random_club_frame = 0;
|
||||
|
||||
if (p->weapon_pos == 0)
|
||||
{
|
||||
p->weapon_pos = -1;
|
||||
p->last_weapon = curr_weapon;
|
||||
}
|
||||
else if ((unsigned)p->weapon_pos < WEAPON_POS_RAISE)
|
||||
{
|
||||
p->weapon_pos = -p->weapon_pos;
|
||||
else p->weapon_pos = WEAPON_POS_LOWER;
|
||||
p->last_weapon = curr_weapon;
|
||||
}
|
||||
else if (p->last_weapon == weapon)
|
||||
{
|
||||
p->last_weapon = -1;
|
||||
p->weapon_pos = -p->weapon_pos;
|
||||
}
|
||||
|
||||
if (p->holster_weapon)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue