From: FruitieX Date: Tue, 26 Oct 2010 16:15:55 +0000 (+0300) Subject: fix terencehill's code X-Git-Tag: xonotic-v0.5.0~348^2~6^2~2^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b02eb66e3a23baaca99809d6ad048d3c28d519b1;p=xonotic%2Fxonotic-data.pk3dir.git fix terencehill's code --- diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 3f96e9a24..8cda4b13e 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -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 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 8e5448b83..fe5aa3ddc 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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(); diff --git a/qcsrc/server/domination.qc b/qcsrc/server/domination.qc index 17e2e5fe0..2c5d48697 100644 --- a/qcsrc/server/domination.qc +++ b/qcsrc/server/domination.qc @@ -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; };