r2591 - trunk/data/qcsrc/server

savagex at icculus.org savagex at icculus.org
Fri May 18 09:31:59 EDT 2007


Author: savagex
Date: 2007-05-18 09:31:59 -0400 (Fri, 18 May 2007)
New Revision: 2591

Modified:
   trunk/data/qcsrc/server/assault.qc
Log:
target_objective_decrease is now only triggerable once per round. Added 
checks and reset code.


Modified: trunk/data/qcsrc/server/assault.qc
===================================================================
--- trunk/data/qcsrc/server/assault.qc	2007-05-18 12:15:31 UTC (rev 2590)
+++ trunk/data/qcsrc/server/assault.qc	2007-05-18 13:31:59 UTC (rev 2591)
@@ -50,6 +50,9 @@
 
 // decrease the health of targeted objectives
 void assault_objective_decrease() {
+	// can only be triggered once per round
+	if(self.cnt > 0)
+		return;
 
 	local entity ent;
 	local entity oldself;
@@ -58,10 +61,15 @@
 		ent.health = ent.health - self.dmg;
 		ent = find(ent, targetname, self.target);
 	}
+
+	self.cnt = 1;
 }
 
 // this entity should target an objective and be targeted by triggers
 void target_objective_decrease() {
+	self.cnt = 0;
+	self.classname = "target_objective_decrease";
+
 	if(!self.dmg) {
 		self.dmg = 101;
 	}
@@ -95,7 +103,6 @@
 	} 
 
 	// reset all objectives
-
 	ent = find(world, classname, "target_objective");
 	while (ent)
 	{
@@ -107,6 +114,15 @@
 		ent = find(ent, classname, "target_objective");
 	} 
 
+	// reset all target_objective_decrease
+	ent = find(world, classname, "target_objective_decrease");
+	while (ent)
+	{
+		ent.cnt = 0;
+		ent = find(ent, classname, "target_objective_decrease");
+	} 
+
+
 	// actually restart round... how to do that?
 }
 




More information about the nexuiz-commits mailing list