From: Mario Date: Sat, 4 Mar 2017 17:22:56 +0000 (+1000) Subject: Give item respawn maths some bounds X-Git-Tag: xonotic-v0.8.2~138 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a74f74264fcae78e13146f10d20beaa5b8cd8299;p=xonotic%2Fxonotic-data.pk3dir.git Give item respawn maths some bounds --- 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)