]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/round_handler.qc
Fix current custom gametype not being kept if gametype vote ends without votes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / round_handler.qc
index b22ba178d61d0c2ecbcb3f398a7868a25b595b0b..d47aad441ec4add47fcbd7cba5eb8c39b5b0dc75 100644 (file)
@@ -1,9 +1,11 @@
 #include "round_handler.qh"
 
 #include <common/mapobjects/triggers.qh>
+#include <common/scores.qh>
 #include <common/util.qh>
 #include <server/campaign.qh>
 #include <server/command/vote.qh>
+#include <server/scores.qh>
 #include <server/world.qh>
 
 void round_handler_Think(entity this)
@@ -39,6 +41,9 @@ void round_handler_Think(entity this)
                        int f = this.cnt - 1;
                        if (f == 0)
                        {
+                               FOREACH_CLIENT((IS_PLAYER(it) || INGAME(it)), {
+                                       GameRules_scoring_add(it, ROUNDS_PL, 1);
+                               });
                                this.cnt = 0;
                                this.round_endtime = (this.round_timelimit) ? time + this.round_timelimit : 0;
                                this.nextthink = time;
@@ -105,6 +110,8 @@ void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, voi
        this.wait = false;
        round_handler_Init(5, 5, 180);
        this.nextthink = time;
+
+       ScoreInfo_SetLabel_PlayerScore(SP_ROUNDS_PL, "rounds_pl", 0);
 }
 
 void round_handler_Reset(float next_think)