r5239 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Dec 16 07:32:23 EST 2008


Author: div0
Date: 2008-12-16 07:32:22 -0500 (Tue, 16 Dec 2008)
New Revision: 5239

Modified:
   trunk/data/qcsrc/client/hook.qc
   trunk/data/qcsrc/client/teamplay.qc
Log:
make display of hook less weird


Modified: trunk/data/qcsrc/client/hook.qc
===================================================================
--- trunk/data/qcsrc/client/hook.qc	2008-12-16 12:21:55 UTC (rev 5238)
+++ trunk/data/qcsrc/client/hook.qc	2008-12-16 12:32:22 UTC (rev 5239)
@@ -75,28 +75,16 @@
 
 void Net_GrapplingHook()
 {
-	float i;
-	vector start, end;
-	entity p;
+	self.sv_entnum = ReadShort();
+	self.HookEnd_x = ReadCoord();
+	self.HookEnd_y = ReadCoord();
+	self.HookEnd_z = ReadCoord();
+	self.HookStart_x = ReadCoord();
+	self.HookStart_y = ReadCoord();
+	self.HookStart_z = ReadCoord();
 
-	i = ReadShort();
-	end_x = ReadCoord();
-	end_y = ReadCoord();
-	end_z = ReadCoord();
-	start_x = ReadCoord();
-	start_y = ReadCoord();
-	start_z = ReadCoord();
+	self.HookKillTime = time + 0.1;
+	self.draw = Draw_GrapplingHook;
 
-	if(i <= 0 || i >= 256) // not owned by a client
-		return;
-	--i;
-
-	p = playerslots[i];
-	if(!p)
-		return;
-
-	p.HookKillTime = time + 0.1;
-	p.HookStart = start;
-	p.HookEnd = end;
-	p.draw = Draw_GrapplingHook;
+	self.team = GetPlayerColorForce(self.sv_entnum);
 }

Modified: trunk/data/qcsrc/client/teamplay.qc
===================================================================
--- trunk/data/qcsrc/client/teamplay.qc	2008-12-16 12:21:55 UTC (rev 5238)
+++ trunk/data/qcsrc/client/teamplay.qc	2008-12-16 12:32:22 UTC (rev 5239)
@@ -14,16 +14,22 @@
 	}
 }
 
+float GetPlayerColorForce(float i)
+{
+	if(!teamplay)
+		return 0;
+	else
+		return stof(getplayerkey(i, "colors")) & 15;
+}
+
 float GetPlayerColor(float i)
 {
 	if not(playerslots[i].gotscores) // unconnected
 		return COLOR_SPECTATOR;
 	else if(getplayerkey(i, "frags") == "-666")
 		return COLOR_SPECTATOR;
-	else if(!teamplay)
-		return 0;
 	else
-		return stof(getplayerkey(i, "colors")) & 15;
+		return GetPlayerColorForce(i);
 }
 
 vector GetTeamRGB(float color)




More information about the nexuiz-commits mailing list