[nexuiz-commits] r6860 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jun 4 05:56:54 EDT 2009


Author: div0
Date: 2009-06-04 05:56:53 -0400 (Thu, 04 Jun 2009)
New Revision: 6860

Modified:
   trunk/data/qcsrc/server/t_items.qc
Log:
target_items: properly handle fuel regen/rot when changing ammo_fuel


Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc	2009-06-04 01:07:00 UTC (rev 6859)
+++ trunk/data/qcsrc/server/t_items.qc	2009-06-04 09:56:53 UTC (rev 6860)
@@ -1229,7 +1229,7 @@
 
 void target_items_use (void)
 {
-	float h0, a0;
+	float h0, a0, f0;
 
 	if(activator.classname == "droppedweapon")
 	{
@@ -1257,6 +1257,7 @@
 
 	a0 = activator.armorvalue;
 	h0 = activator.health;
+	f0 = activator.ammo_fuel;
 	target_item_changed = 0;
 
 	if(self.spawnflags == 0) // SET
@@ -1338,6 +1339,11 @@
 	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"));
 



More information about the nexuiz-commits mailing list