mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-12 23:54:27 +00:00
Fixed g_swap_speed behaviour with extreme values
When its value was between 0 and 1, rounded down to 0; did the same when bigger than 65535. Both cases locked up the weapon animation.
This commit is contained in:
parent
16eee95bb8
commit
92a00c9f5d
1 changed files with 3 additions and 1 deletions
|
@ -691,7 +691,9 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int F
|
||||||
int FRAME_DEACTIVATE_LAST, int *pause_frames, int *fire_frames, void (*fire)(edict_t *ent))
|
int FRAME_DEACTIVATE_LAST, int *pause_frames, int *fire_frames, void (*fire)(edict_t *ent))
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
const unsigned short int change_speed = (g_swap_speed->value > 0)?(unsigned short int)g_swap_speed->value:1;
|
const unsigned short int change_speed = (g_swap_speed->value > 1)?
|
||||||
|
(g_swap_speed->value < USHRT_MAX)? (unsigned short int)g_swap_speed->value : 1
|
||||||
|
: 1;
|
||||||
|
|
||||||
if (!ent || !fire)
|
if (!ent || !fire)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue