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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Aug 16 12:06:44 EDT 2009


Author: mand1nga
Date: 2009-08-16 12:06:42 -0400 (Sun, 16 Aug 2009)
New Revision: 7448

Modified:
   trunk/data/qcsrc/server/g_world.qc
   trunk/data/qcsrc/server/mode_onslaught.qc
Log:
Fix audio spam on generator auto-destruction. Disallow complete destruction of generators in warmup stage.

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2009-08-16 16:06:15 UTC (rev 7447)
+++ trunk/data/qcsrc/server/g_world.qc	2009-08-16 16:06:42 UTC (rev 7448)
@@ -122,7 +122,7 @@
 			remove(self);
 			return;
 		}
-		
+
 	}
 	else if (timeoutStatus == 0) { //if a player called the resumegame command (which set timeoutStatus to 0 already)
 		FOR_EACH_REALCLIENT(plr) {
@@ -301,7 +301,7 @@
 		tracebox(o, PL_MIN, PL_MAX, o - '0 0 32768', MOVE_WORLDONLY, world);
 		if(trace_fraction == 1)
 			continue;
-		
+
 		v = trace_endpos;
 
 		for(i = 0; i < 64; i += 4)
@@ -591,7 +591,7 @@
 	addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
 	addstat(STAT_ALLOW_OLDNEXBEAM, AS_INT, stat_allow_oldnexbeam);
 	Nagger_Init();
-	
+
 	addstat(STAT_STRENGTH_FINISHED, AS_FLOAT, strength_finished);
 	addstat(STAT_INVINCIBLE_FINISHED, AS_FLOAT, invincible_finished);
 	addstat(STAT_PRESSED_KEYS, AS_FLOAT, pressedkeys);
@@ -1222,7 +1222,7 @@
 			GameLogEcho(s);
 		if(to_file)
 			fputs(file, strcat(s, "\n"));
-	
+
 		for(i = 1; i < 16; ++i)
 		{
 			s = strcat(":teamscores:see-labels:", GetTeamScoreString(i, 0));
@@ -1405,7 +1405,7 @@
 			minutesPlural = " ^3minute";
 		else
 			minutesPlural = " ^3minutes";
-		
+
 		bcenterprint(
 			strcat(
 				"^3Now playing ^1OVERTIME^3!\n\n^3Added ^1",
@@ -1415,7 +1415,7 @@
 			)
 		);
 	}
-	else 
+	else
 	{
 		if(!checkrules_suddendeathend)
 		{
@@ -1474,6 +1474,9 @@
 
 	WinningConditionHelper(); // set worldstatus
 
+	if(inWarmupStage)
+		return WINNING_NO;
+
 	// first check if the game has ended
 	t1 = t2 = t3 = t4 = 0;
 	head = find(world, classname, "onslaught_generator");
@@ -1660,7 +1663,7 @@
 {
 	// TODO make everything use THIS winning condition (except LMS)
 	WinningConditionHelper();
-	
+
 	if(teams_matter)
 	{
 		team1_score = TeamScore_GetCompareValue(COLOR_TEAM1);
@@ -1668,7 +1671,7 @@
 		team3_score = TeamScore_GetCompareValue(COLOR_TEAM3);
 		team4_score = TeamScore_GetCompareValue(COLOR_TEAM4);
 	}
-	
+
 	ClearWinners();
 	if(WinningConditionHelper_winner)
 		WinningConditionHelper_winner.winning = 1;

Modified: trunk/data/qcsrc/server/mode_onslaught.qc
===================================================================
--- trunk/data/qcsrc/server/mode_onslaught.qc	2009-08-16 16:06:15 UTC (rev 7447)
+++ trunk/data/qcsrc/server/mode_onslaught.qc	2009-08-16 16:06:42 UTC (rev 7448)
@@ -402,25 +402,24 @@
 	local float d;
 	local entity e;
 	self.nextthink = ceil(time + 1);
-	if (cvar("timelimit"))
-		if (time > cvar("timelimit") * 60 - 60)
+	if (cvar("timelimit") && !gameover)
+	if (time > cvar("timelimit") * 60 - 60)
+	{
+		// self.max_health / 300 gives 5 minutes of overtime.
+		// control points reduce the overtime duration.
+		sound(self, CHAN_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
+		d = 1;
+		e = findchain(classname, "onslaught_controlpoint");
+		while (e)
 		{
-			// self.max_health / 300 gives 5 minutes of overtime.
-			// control points reduce the overtime duration.
-			sound(self, CHAN_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
-			d = 1;
-			e = findchain(classname, "onslaught_controlpoint");
-			while (e)
-			{
-				if (e.team != self.team)
-					if (e.islinked)
-						d = d + 1;
-				e = e.chain;
-			}
-			d = d * self.max_health / 300;
-			Damage(self, self, self, d, DEATH_HURTTRIGGER, self.origin, '0 0 0');
+			if (e.team != self.team)
+				if (e.islinked)
+					d = d + 1;
+			e = e.chain;
 		}
-
+		d = d * self.max_health / 300;
+		Damage(self, self, self, d, DEATH_HURTTRIGGER, self.origin, '0 0 0');
+	}
 };
 
 void onslaught_generator_ring_think()
@@ -659,7 +658,7 @@
 #endif
 		self.lasthealth = self.health;
 	}
-	else
+	else if not(inWarmupStage)
 	{
 		if (attacker == self)
 			bprint(ColoredTeamName(self.team), " generator spontaneously exploded due to overtime!\n");
@@ -683,6 +682,7 @@
 
 		onslaught_updatelinks();
 	}
+
 	if(self.health <= 0)
 		setmodel(self, "models/onslaught/generator_dead.md3");
 	else if(self.health < self.max_health * 0.10)



More information about the nexuiz-commits mailing list