From: terencehill Date: Wed, 3 Nov 2010 21:46:23 +0000 (+0100) Subject: Set default values for self.DOMPOINTFRAGS and self.wait vars even if they're negative... X-Git-Tag: xonotic-v0.5.0~348^2~6^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8f427daf05b4b9e8573e31b0e7067d7203541419;p=xonotic%2Fxonotic-data.pk3dir.git Set default values for self.DOMPOINTFRAGS and self.wait vars even if they're negative: negative values don't make sense and would break stats Move total_pps calculation in a better place, after the checks of those vars, removing redundant checks. --- diff --git a/qcsrc/server/domination.qc b/qcsrc/server/domination.qc index 2c5d48697..c163ab0fe 100644 --- a/qcsrc/server/domination.qc +++ b/qcsrc/server/domination.qc @@ -367,11 +367,23 @@ void dom_controlpoint_setup() if(!self.message) self.message = " has captured a control point"; - if(!self.DOMPOINTFRAGS) + if(self.DOMPOINTFRAGS <= 0) self.DOMPOINTFRAGS = 1; - if(!self.wait) + if(self.wait <= 0) self.wait = 5; + float points, waittime; + if (g_domination_point_rate) + points = g_domination_point_rate; + else + points = self.frags; + if (g_domination_point_amt) + waittime = g_domination_point_amt; + else + waittime = self.wait; + + total_pps += points/waittime; + if(!self.t_width) self.t_width = 0.02; // frame animation rate if(!self.t_length) @@ -605,22 +617,6 @@ void spawnfunc_dom_controlpoint() self.effects = self.effects | EF_LOWPRECISION; if (cvar("g_domination_point_fullbright")) self.effects |= EF_FULLBRIGHT; - - float points, waittime; - if (g_domination_point_rate) - points = g_domination_point_rate; - else - points = self.frags; - if(points == 0) // default - points = 1; - - if (g_domination_point_amt) - waittime = g_domination_point_amt; - else - waittime = self.wait; - if(waittime == 0) // default - waittime = 5; - total_pps += points/waittime; }; // code from here on is just to support maps that don't have control point and team entities