]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/domination.qc
Merge remote branch 'refs/remotes/origin/fruitiex/racefixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / domination.qc
index d87d8419b25b5302d127ecd49780191e1601d3d0..3e5bed8b25f23c35247fa2cf1c50c14da053dc3c 100644 (file)
@@ -17,6 +17,9 @@ Note: The only teams who can use dom control points are identified by spawnfunc_
 
 #define DOMPOINTFRAGS frags
 
+float g_domination_point_amt;
+float g_domination_point_rate;
+
 .float enemy_playerid;
 .entity sprite;
 .float captime;
@@ -63,7 +66,22 @@ void dompoint_captured ()
        //bprint(self.message);
        //bprint("\n");
 
-       bprint("^3", head.netname, "^3", self.message, "\n");
+       float points, wait_time;
+       if (g_domination_point_amt)
+               points = g_domination_point_amt;
+       else
+               points = self.frags;
+       if (g_domination_point_rate)
+               wait_time = g_domination_point_rate;
+       else
+               wait_time = self.wait;
+
+       bprint("^3", head.netname, "^3", self.message);
+       if (points != 1)
+               bprint(" ^7(", ftos(points), " points every ", ftos(wait_time), " seconds)\n");
+       else
+               bprint(" ^7(", ftos(points), " point every ", ftos(wait_time), " seconds)\n");
+
        if(self.enemy.playerid == self.enemy_playerid)
                PlayerScore_Add(self.enemy, SP_DOM_TAKES, 1);
        else
@@ -80,10 +98,7 @@ void dompoint_captured ()
        //self.nextthink = time + cvar("g_domination_point_rate");
        //self.think = dompointthink;
 
-       if(cvar("g_domination_point_rate"))
-               self.delay = time + cvar("g_domination_point_rate");
-       else
-               self.delay = time + self.wait;
+       self.delay = time + wait_time;
 
        // do trigger work
        old_delay = self.delay;
@@ -131,7 +146,6 @@ void AnimateDomPoint()
 
 void dompointthink()
 {
-       local float waittime;
        local float fragamt;
 
        self.nextthink = time + 0.1;
@@ -146,17 +160,21 @@ void dompointthink()
        if (gameover || self.delay > time || time < game_starttime)     // game has ended, don't keep giving points
                return;
 
-       waittime = cvar("g_domination_point_rate");
-       if(!waittime)
-               waittime = self.wait;
-       self.delay = time + waittime;
+       g_domination_point_rate = cvar("g_domination_point_rate");
+       g_domination_point_amt = cvar("g_domination_point_amt");
+
+       if(g_domination_point_rate)
+               self.delay = time + g_domination_point_rate;
+       else
+               self.delay = time + self.wait;
 
        // give credit to the team
        // NOTE: this defaults to 0
        if (self.goalentity.netname != "")
        {
-               fragamt = cvar("g_domination_point_amt");
-               if(!fragamt)
+               if(g_domination_point_amt)
+                       fragamt = g_domination_point_amt;
+               else
                        fragamt = self.DOMPOINTFRAGS;
                TeamScore_AddToTeam(self.goalentity.team, ST_SCORE, fragamt);
                TeamScore_AddToTeam(self.goalentity.team, ST_DOM_TICKS, fragamt);