]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix terencehill's code
authorFruitieX <rasse@rasse-laptop.(none)>
Tue, 26 Oct 2010 16:15:55 +0000 (19:15 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Tue, 26 Oct 2010 16:15:55 +0000 (19:15 +0300)
qcsrc/common/constants.qh
qcsrc/server/cl_client.qc
qcsrc/server/domination.qc

index 3f96e9a24ac1c8ef28a4790b90da17df3df79ed0..8cda4b13ec41ed0e9664c5445bd81d79980bacb6 100644 (file)
@@ -312,12 +312,6 @@ const float STAT_BULLETS_LOADED = 48;
 const float STAT_NEX_CHARGE = 49;
 const float STAT_HUD = 50;
 
-const float STAT_DOM_TOTAL_PPS = 70;
-const float STAT_DOM_PPS_RED = 71;
-const float STAT_DOM_PPS_BLUE = 72;
-const float STAT_DOM_PPS_PINK = 73;
-const float STAT_DOM_PPS_YELLOW = 74;
-
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
 const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223;
@@ -347,6 +341,12 @@ const float STAT_VEHICLESTAT_RELOAD2 = 66;
 const float STAT_REDALIVE = 100;
 const float STAT_BLUEALIVE = 101;
 
+const float STAT_DOM_TOTAL_PPS = 100;
+const float STAT_DOM_PPS_RED = 101;
+const float STAT_DOM_PPS_BLUE = 102;
+const float STAT_DOM_PPS_PINK = 103;
+const float STAT_DOM_PPS_YELLOW = 104;
+
 //const float STAT_SPIDERBOT_AIM     53 // compressShotOrigin
 //const float STAT_SPIDERBOT_TARGET  54 // compressShotOrigin
 
index 8e5448b83384a0c8dad0ab6582bfd6b14db9b3a0..fe5aa3ddc4b0a161ec9b75ad30addc34c807238e 100644 (file)
@@ -1402,7 +1402,7 @@ Called when a client connects to the server
 string ColoredTeamName(float t);
 void DecodeLevelParms (void);
 //void dom_player_join_team(entity pl);
-void set_dom_state(entity e, float connecting);
+void set_dom_state(void);
 void ClientConnect (void)
 {
        float t;
@@ -1604,7 +1604,7 @@ void ClientConnect (void)
                send_CSQC_teamnagger();
 
        if (g_domination)
-               set_dom_state(self, TRUE);
+               set_dom_state();
        send_CSQC_cr_maxbullets(self);
 
        CheatInitClient();
index 17e2e5fe0bbaabfefd1f8dd4790129b5778a035e..2c5d4869727bead678a0b2483d1866182167ebb6 100644 (file)
@@ -35,13 +35,20 @@ float pps_red;
 float pps_blue;
 float pps_yellow;
 float pps_pink;
-void set_dom_state(entity e, float connecting)
+void set_dom_state(void)
 {
-       if(connecting)  e.dom_total_pps = total_pps;
-                                       e.dom_pps_red = pps_red;
-                                       e.dom_pps_blue = pps_blue;
-       if(c3 >= 0)             e.dom_pps_yellow = pps_yellow;
-       if(c4 >= 0)             e.dom_pps_pink = pps_pink;
+       // BIG ugly hack to make stat sending work
+       self.dom_total_pps = total_pps;
+       self.dom_pps_red = pps_red;
+       self.dom_pps_blue = pps_blue;
+       if(c3 >= 0)
+       {
+               self.dom_pps_yellow = pps_yellow;
+       }
+       if(c4 >= 0)
+       {
+               self.dom_pps_pink = pps_pink;
+       }
 }
 
 void() dom_controlpoint_setup;
@@ -174,8 +181,8 @@ void dompoint_captured ()
                        WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
        }
 
-       FOR_EACH_CLIENT(head)
-               set_dom_state(head, FALSE);
+       FOR_EACH_PLAYER(self)
+               set_dom_state();
 
        WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
        WaypointSprite_Ping(self.sprite);
@@ -601,13 +608,18 @@ void spawnfunc_dom_controlpoint()
        
        float points, waittime;
        if (g_domination_point_rate)
-               points += g_domination_point_rate;
+               points = g_domination_point_rate;
        else
-               points += self.frags;
+               points = self.frags;
+       if(points == 0) // default
+               points = 1;
+
        if (g_domination_point_amt)
-               waittime += g_domination_point_amt;
+               waittime = g_domination_point_amt;
        else
-               waittime += self.wait;
+               waittime = self.wait;
+       if(waittime == 0) // default
+               waittime = 5;
        total_pps += points/waittime;
 };