]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_race.qc
Move team player spawn functions into the spawnpoints file
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_race.qc
index 3cb26f1311be9c80ca61336abe531ab7f09bdfae..a7a832281a870ec8d3a32fb56e51f0f1c218181c 100644 (file)
@@ -1,3 +1,10 @@
+#include "gamemode_race.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../race.qh"
+
 // legacy bot roles
 .float race_checkpoint;
 void havocbot_role_race()
@@ -66,11 +73,11 @@ MUTATOR_HOOKFUNCTION(race_PlayerPhysics)
        // ensure nothing EVIL is being done (i.e. div0_evade)
        // this hinders joystick users though
        // but it still gives SOME analog control
-       wishvel_x = fabs(self.movement.x);
-       wishvel_y = fabs(self.movement.y);
+       wishvel.x = fabs(self.movement.x);
+       wishvel.y = fabs(self.movement.y);
        if(wishvel.x != 0 && wishvel.y != 0 && wishvel.x != wishvel.y)
        {
-               wishvel_z = 0;
+               wishvel.z = 0;
                wishspeed = vlen(wishvel);
                if(wishvel.x >= 2 * wishvel.y)
                {
@@ -103,7 +110,7 @@ MUTATOR_HOOKFUNCTION(race_PlayerPhysics)
                                self.movement_y = -M_SQRT1_2 * wishspeed;
                }
        }
-       
+
        return false;
 }
 
@@ -137,7 +144,7 @@ MUTATOR_HOOKFUNCTION(race_ResetMap)
                cvar_set("timelimit", ftos(race_timelimit));
                race_ScoreRules();
        }
-       
+
        return false;
 }
 
@@ -203,7 +210,7 @@ MUTATOR_HOOKFUNCTION(race_PlayerSpawn)
        self.race_respawn_spotref = spawn_spot;
 
        self.race_place = 0;
-       
+
        return false;
 }
 
@@ -266,6 +273,15 @@ MUTATOR_HOOKFUNCTION(race_GetTeamCount)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(race_CountFrags)
+{
+       // announce remaining frags if not in qualifying mode
+       if(!g_race_qualifying)
+               return true;
+
+       return false;
+}
+
 void race_Initialize()
 {
        race_ScoreRules();
@@ -287,6 +303,7 @@ MUTATOR_DEFINITION(gamemode_race)
        MUTATOR_HOOK(GetPressedKeys, race_PlayerPostThink, CBC_ORDER_ANY);
        MUTATOR_HOOK(ForbidPlayerScore_Clear, race_ForbidClearPlayerScore, CBC_ORDER_ANY);
        MUTATOR_HOOK(GetTeamCount, race_GetTeamCount, CBC_ORDER_ANY);
+       MUTATOR_HOOK(Scores_CountFragsRemaining, race_CountFrags, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {
@@ -304,7 +321,7 @@ MUTATOR_DEFINITION(gamemode_race)
 
        MUTATOR_ONREMOVE
        {
-               print("This is a game type and it cannot be removed at runtime.");
+               LOG_INFO("This is a game type and it cannot be removed at runtime.");
                return -1;
        }