]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give item respawn maths some bounds
authorMario <mario@smbclan.net>
Sat, 4 Mar 2017 17:22:56 +0000 (03:22 +1000)
committerMario <mario@smbclan.net>
Sat, 4 Mar 2017 17:22:56 +0000 (03:22 +1000)
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/t_items.qc

index 2cf64713512a9c0b73eed621a9cb3dac4be0fe1e..7048e541f4d3397a104afba7b3ea0342d669883b 100644 (file)
@@ -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;
 
index a90b424c951a1f4a43e738aeda21d1e659a704a5..ff7f2feaf1c5a01d587010c7c4ebc42101a78906 100644 (file)
@@ -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)