r3008 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Dec 7 13:54:16 EST 2007


Author: div0
Date: 2007-12-07 13:54:16 -0500 (Fri, 07 Dec 2007)
New Revision: 3008

Modified:
   trunk/data/qcsrc/server/ctf.qc
Log:
add noalign support to flags


Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc	2007-12-07 18:08:17 UTC (rev 3007)
+++ trunk/data/qcsrc/server/ctf.qc	2007-12-07 18:54:16 UTC (rev 3008)
@@ -1,6 +1,7 @@
 
 .float next_take_time;			// the next time a player can pick up a flag (time + blah)
 								/// I used this, in part, to fix the looping score bug. - avirox
+.float movetype_orig;
 
 //float FLAGSCORE_PICKUP        =  1;
 //float FLAGSCORE_RETURN        =  5; // returned by owner team
@@ -24,7 +25,7 @@
 	self.mdl = self.model;
 	self.flags = FL_ITEM;
 	self.solid = SOLID_TRIGGER;
-	self.movetype = MOVETYPE_TOSS;
+	self.movetype = self.movetype_orig;
 	self.velocity = '0 0 0';
 	self.origin_z = self.origin_z + 6;
 	self.think = FlagThink;
@@ -34,12 +35,13 @@
 	self.mangle = self.angles;
 	self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
 	//self.effects = self.effects | EF_DIMLIGHT;
-	if (!droptofloor())
-	{
-		dprint("Flag fell out of level at ", vtos(self.origin), "\n");
-		remove(self);
-		return;
-	}
+	if(!self.noalign)
+		if (!droptofloor())
+		{
+			dprint("Flag fell out of level at ", vtos(self.origin), "\n");
+			remove(self);
+			return;
+		}
 	self.oldorigin = self.origin;
 };
 
@@ -58,7 +60,7 @@
 void(entity e) RegenFlag =
 {
 	setattachment(e, world, "");
-	e.movetype = MOVETYPE_TOSS;
+	e.movetype = self.movetype_orig;
 	e.solid = SOLID_TRIGGER;
 	// TODO: play a sound here
 	setorigin(e, e.oldorigin);
@@ -406,6 +408,8 @@
 	self.netname = "^1RED^7 flag";
 	self.target = "###item###";
 	self.skin = 0;
+	if(self.spawnflags & 1)
+		self.noalign = 1;
 	if (!self.model)
 		self.model = "models/ctf/flag_red.md3";
 	if (!self.noise)
@@ -433,7 +437,8 @@
 	//	self.glow_size = 50;
 
 	self.effects = self.effects | EF_FULLBRIGHT | EF_LOWPRECISION;
-	droptofloor();
+	if(!self.noalign)
+		droptofloor();
 
 	WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 37');
 };
@@ -462,6 +467,8 @@
 	self.netname = "^4BLUE^7 flag";
 	self.target = "###item###";
 	self.skin = 0;
+	if(self.spawnflags & 1)
+		self.noalign = 1;
 	if (!self.model)
 		self.model = "models/ctf/flag_blue.md3";
 	if (!self.noise)
@@ -489,7 +496,8 @@
 	//	self.glow_size = 50;
 
 	self.effects = self.effects | EF_FULLBRIGHT | EF_LOWPRECISION;
-	droptofloor();
+	if(!self.noalign)
+		droptofloor();
 
 	WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 37');
 };




More information about the nexuiz-commits mailing list