mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-22 20:31:50 +00:00
Snappier "g_swap_speed" behaviour
Player is no longer forced to go through the last frame of activation or deactivation of a weapon before changing its state.
This commit is contained in:
parent
15c531c300
commit
8319109c9f
1 changed files with 2 additions and 10 deletions
|
@ -705,7 +705,7 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int F
|
||||||
|
|
||||||
if (ent->client->weaponstate == WEAPON_DROPPING)
|
if (ent->client->weaponstate == WEAPON_DROPPING)
|
||||||
{
|
{
|
||||||
if (ent->client->ps.gunframe == FRAME_DEACTIVATE_LAST)
|
if (ent->client->ps.gunframe >= FRAME_DEACTIVATE_LAST - change_speed + 1)
|
||||||
{
|
{
|
||||||
ChangeWeapon(ent);
|
ChangeWeapon(ent);
|
||||||
return;
|
return;
|
||||||
|
@ -722,16 +722,12 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int F
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->client->ps.gunframe += change_speed;
|
ent->client->ps.gunframe += change_speed;
|
||||||
if (ent->client->ps.gunframe > FRAME_DEACTIVATE_LAST)
|
|
||||||
{
|
|
||||||
ent->client->ps.gunframe = FRAME_DEACTIVATE_LAST;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ent->client->weaponstate == WEAPON_ACTIVATING)
|
if (ent->client->weaponstate == WEAPON_ACTIVATING)
|
||||||
{
|
{
|
||||||
if (ent->client->ps.gunframe == FRAME_ACTIVATE_LAST)
|
if (ent->client->ps.gunframe >= FRAME_ACTIVATE_LAST - change_speed + 1)
|
||||||
{
|
{
|
||||||
ent->client->weaponstate = WEAPON_READY;
|
ent->client->weaponstate = WEAPON_READY;
|
||||||
ent->client->ps.gunframe = FRAME_IDLE_FIRST;
|
ent->client->ps.gunframe = FRAME_IDLE_FIRST;
|
||||||
|
@ -739,10 +735,6 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int F
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->client->ps.gunframe += change_speed;
|
ent->client->ps.gunframe += change_speed;
|
||||||
if (ent->client->ps.gunframe > FRAME_ACTIVATE_LAST)
|
|
||||||
{
|
|
||||||
ent->client->ps.gunframe = FRAME_ACTIVATE_LAST;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue