From: MirceaKitsune Date: Wed, 8 Sep 2010 09:37:34 +0000 (+0300) Subject: Respawn time -1 for items: Allows the item to never respawn again after being picked up X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e8d42583b59129ed67a3b784b6349a2327027b20;p=voretournament%2Fvoretournament.git Respawn time -1 for items: Allows the item to never respawn again after being picked up --- diff --git a/Todo & known bugs.txt b/Todo & known bugs.txt index 71ad134b..8efebe21 100644 --- a/Todo & known bugs.txt +++ b/Todo & known bugs.txt @@ -4,6 +4,4 @@ Todo: - Bots must learn to use the Grabber gun. The weapon code of havocbot is still there, but doesn't know how to shoot the Grabber -- Allow an item respawn time of -1 (never respawn again). Useful for RPG and Single Player maps - Known bugs: diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index f37e3a2d..71b38056 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -46,7 +46,7 @@ float Item_Customize() } else { - if(g_ghost_items) + if(g_ghost_items && self.respawntime > 0) { self.colormod = stov(cvar_string("g_ghost_items_color")); self.glowmod = self.colormod; @@ -97,7 +97,7 @@ void Item_Show (entity e, float mode) e.spawnshieldtime = 0; // field indicates whether picking it up may give you anything other than the weapon } - else if(g_ghost_items) + else if(g_ghost_items && self.respawntime > 0) { // make the item translucent green and not touchable e.model = e.mdl; @@ -208,7 +208,8 @@ void Item_ScheduleRespawnIn(entity e, float t) void Item_ScheduleRespawn(entity e) { Item_Show(e, 0); - Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e)); + if(e.respawntime > 0) + Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e)); } void Item_ScheduleInitialRespawn(entity e)