From a74f74264fcae78e13146f10d20beaa5b8cd8299 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 5 Mar 2017 03:22:56 +1000 Subject: [PATCH] Give item respawn maths some bounds --- qcsrc/common/mutators/mutator/buffs/sv_buffs.qc | 2 +- qcsrc/common/t_items.qc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 2cf647135..7048e541f 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -370,7 +370,7 @@ void buff_Init(entity this) //this.gravity = 100; this.color = buff.m_color; this.glowmod = buff_GlowColor(this); - buff_SetCooldown(this, autocvar_g_buffs_cooldown_activate + (game_starttime - time)); + buff_SetCooldown(this, autocvar_g_buffs_cooldown_activate + max(0, game_starttime - time)); this.buff_active = !this.buff_activetime; this.pflags = PFLAGS_FULLDYNAMIC; diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index a90b424c9..ff7f2feaf 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -627,7 +627,7 @@ void Item_ScheduleRespawn(entity e) void Item_ScheduleInitialRespawn(entity e) { Item_Show(e, 0); - Item_ScheduleRespawnIn(e, game_starttime - time + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e))); + Item_ScheduleRespawnIn(e, max(0, game_starttime - time) + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e))); } float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode) -- 2.39.2