r5603 - in trunk/data/qcsrc: client common server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Jan 18 14:10:03 EST 2009
Author: div0
Date: 2009-01-18 14:10:02 -0500 (Sun, 18 Jan 2009)
New Revision: 5603
Modified:
trunk/data/qcsrc/client/ctf.qc
trunk/data/qcsrc/client/teamplay.qc
trunk/data/qcsrc/common/constants.qh
trunk/data/qcsrc/server/cl_client.qc
trunk/data/qcsrc/server/defs.qh
Log:
set -616 frags for nonsolid players; that way the engine can know about them, and not collide against them
Modified: trunk/data/qcsrc/client/ctf.qc
===================================================================
--- trunk/data/qcsrc/client/ctf.qc 2009-01-18 15:23:24 UTC (rev 5602)
+++ trunk/data/qcsrc/client/ctf.qc 2009-01-18 19:10:02 UTC (rev 5603)
@@ -39,7 +39,7 @@
frags = getplayerkey(i, "frags");
if(!frags || (i+1) == player_localentnum)
continue;
- if(frags == "-666" || getplayerkey(i, "topcolor") != color)
+ if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam
continue;
++p;
if(p > (8*order_page))
@@ -75,7 +75,7 @@
frags = getplayerkey(i, "frags");
if(!frags || (i+1) == player_localentnum)
continue;
- if(frags == "-666" || getplayerkey(i, "topcolor") != color)
+ if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam
continue;
++p;
}
@@ -89,7 +89,7 @@
frags = getplayerkey(i, "frags");
if(!frags || (i+1) == player_localentnum)
continue;
- if(frags == "-666" || getplayerkey(i, "topcolor") != color)
+ if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam
continue;
++p;
}
@@ -104,7 +104,7 @@
frags = getplayerkey(i, "frags");
if(!frags || (i+1) == player_localentnum)
continue;
- if(frags == "-666" || getplayerkey(i, "topcolor") != color)
+ if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam
continue;
++p;
if(p > (8*order_page))
Modified: trunk/data/qcsrc/client/teamplay.qc
===================================================================
--- trunk/data/qcsrc/client/teamplay.qc 2009-01-18 15:23:24 UTC (rev 5602)
+++ trunk/data/qcsrc/client/teamplay.qc 2009-01-18 19:10:02 UTC (rev 5603)
@@ -26,7 +26,7 @@
{
if not(playerslots[i].gotscores) // unconnected
return COLOR_SPECTATOR;
- else if(getplayerkey(i, "frags") == "-666")
+ else if(stof(getplayerkey(i, "frags")) == FRAGS_SPECTATOR)
return COLOR_SPECTATOR;
else
return GetPlayerColorForce(i);
Modified: trunk/data/qcsrc/common/constants.qh
===================================================================
--- trunk/data/qcsrc/common/constants.qh 2009-01-18 15:23:24 UTC (rev 5602)
+++ trunk/data/qcsrc/common/constants.qh 2009-01-18 19:10:02 UTC (rev 5603)
@@ -410,3 +410,7 @@
#define DEATH_ISWEAPON(t,w) (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
#define WEP_VALID(w) ((w) >= WEP_FIRST && (w) <= WEP_LAST)
+
+#define FRAGS_PLAYER 0
+#define FRAGS_SPECTATOR -666
+#define FRAGS_PLAYER_NONSOLID -616
Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc 2009-01-18 15:23:24 UTC (rev 5602)
+++ trunk/data/qcsrc/server/cl_client.qc 2009-01-18 19:10:02 UTC (rev 5603)
@@ -508,12 +508,12 @@
{
// Only if the player cannot play at all
if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
- self.frags = -666;
+ self.frags = FRAGS_SPECTATOR;
else
- self.frags = -667;
+ self.frags = FRAGS_SPECTATOR; // this was -667 before, is this okay?
}
else
- self.frags = -666;
+ self.frags = FRAGS_SPECTATOR;
}
float RestrictSkin(float s)
@@ -654,6 +654,7 @@
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
+ self.frags = FRAGS_PLAYER;
if(independent_players)
MAKE_INDEPENDENT_PLAYER(self);
self.flags = FL_CLIENT;
@@ -770,7 +771,6 @@
if(self.killcount == -666) {
PlayerScore_Clear(self);
self.killcount = 0;
- self.frags = 0;
}
self.cnt = WEP_LASER;
@@ -1293,7 +1293,7 @@
if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
{
PlayerScore_Add(self, SP_LMS_RANK, 666);
- self.frags = -666; // FIXME do we still need this?
+ self.frags = FRAGS_SPECTATOR; // FIXME do we still need this?
}
}
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2009-01-18 15:23:24 UTC (rev 5602)
+++ trunk/data/qcsrc/server/defs.qh 2009-01-18 19:10:02 UTC (rev 5603)
@@ -489,7 +489,8 @@
float independent_players;
#define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
-#define MAKE_INDEPENDENT_PLAYER(e) ((e).solid = SOLID_TRIGGER)
+#define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER) + ((e).frags = FRAGS_PLAYER_NONSOLID))
+// we're using + here instead of , because fteqcc sucks
string clientstuff;
.float stat_sys_ticrate;
More information about the nexuiz-commits
mailing list