From 54131a15c6306ed7b9b05302e901741409de0beb Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 4 Jun 2009 09:56:53 +0000 Subject: [PATCH] target_items: properly handle fuel regen/rot when changing ammo_fuel git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6860 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/t_items.qc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index d178564d5..0640ceb00 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -1229,7 +1229,7 @@ void target_item_change(float binary, .float field, float(float a, float b) func void target_items_use (void) { - float h0, a0; + float h0, a0, f0; if(activator.classname == "droppedweapon") { @@ -1257,6 +1257,7 @@ void target_items_use (void) a0 = activator.armorvalue; h0 = activator.health; + f0 = activator.ammo_fuel; target_item_changed = 0; if(self.spawnflags == 0) // SET @@ -1338,6 +1339,11 @@ void target_items_use (void) else if(activator.health < h0) activator.pauseregen_finished = max(activator.pauseregen_finished, time + cvar("g_balance_pause_health_regen")); + if(activator.ammo_fuel > f0) + activator.pauserotfuel_finished = max(activator.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot")); + else if(activator.ammo_fuel < f0) + activator.pauseregen_finished = max(activator.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen")); + if(activator.armorvalue > a0) activator.pauserotarmor_finished = max(activator.pauserothealth_finished, time + cvar("g_balance_pause_health_rot")); -- 2.39.2