diff --git a/src/player/weapon.c b/src/player/weapon.c index f36fe2b..acc812b 100644 --- a/src/player/weapon.c +++ b/src/player/weapon.c @@ -685,7 +685,9 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int *fire_frames, void (*fire)(edict_t *ent)) { 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_frames || !fire) {