r2616 - trunk/data/qcsrc/server

savagex at icculus.org savagex at icculus.org
Sat May 19 14:40:43 EDT 2007


Author: savagex
Date: 2007-05-19 14:40:42 -0400 (Sat, 19 May 2007)
New Revision: 2616

Modified:
   trunk/data/qcsrc/server/assault.qc
Log:
target_objective_decrease only fires if activator.team matches the 
attacker team. Defenders now can push buttons without doing the enemy's 
job ;)


Modified: trunk/data/qcsrc/server/assault.qc
===================================================================
--- trunk/data/qcsrc/server/assault.qc	2007-05-19 18:31:48 UTC (rev 2615)
+++ trunk/data/qcsrc/server/assault.qc	2007-05-19 18:40:42 UTC (rev 2616)
@@ -87,6 +87,9 @@
 // decrease the health of targeted objectives
 void assault_objective_decrease() {
 
+	if(activator.team != self.team)
+		return;
+
 	local entity ent;
 	ent = find(world, targetname, self.target);
 	while(ent) {
@@ -110,6 +113,7 @@
 	self.use = assault_objective_decrease;
 	self.mdl = "models/sprites/here.sp2";
 	self.effects = EF_NODEPTHTEST;
+	self.team = COLOR_TEAM1; // red team, swaps every round
 	self.health = ASSAULT_VALUE_INACTIVE;
 	self.max_health = ASSAULT_VALUE_INACTIVE;
 	self.think = assault_objective_decrease_think;
@@ -225,6 +229,11 @@
 	ent = find(world, classname, "target_objective_decrease");
 	while (ent)
 	{
+		if(ent.team == COLOR_TEAM1) {
+			ent.team = COLOR_TEAM2;
+		} else {
+			ent.team = COLOR_TEAM1;
+		}
 		ent.cnt = 0;
 		ent = find(ent, classname, "target_objective_decrease");
 	} 




More information about the nexuiz-commits mailing list