]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Another gamemode specific file and check
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index b202f284f6b664903899c35c0514824928592481..e121e6f965a336e27b7e259822ff21822446be79 100644 (file)
@@ -1,8 +1,8 @@
 #include "g_world.qh"
-#include "_all.qh"
 
 #include "anticheat.qh"
 #include "antilag.qh"
+#include "bot/bot.qh"
 #include "campaign.qh"
 #include "cheats.qh"
 #include "cl_client.qh"
 #include "weapons/weaponstats.qh"
 #include "../common/buffs/all.qh"
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/mapinfo.qh"
 #include "../common/monsters/all.qh"
 #include "../common/monsters/sv_monsters.qh"
 #include "../common/vehicles/all.qh"
 #include "../common/notifications.qh"
+#include "../common/physics.qh"
 #include "../common/playerstats.qh"
 #include "../common/stats.qh"
 #include "../common/teams.qh"
+#include "../common/triggers/trigger/secret.qh"
 #include "../common/util.qh"
 #include "../common/items/all.qh"
 #include "../common/weapons/all.qh"
@@ -556,8 +557,7 @@ spawnfunc(__init_dedicated_server)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
+       static_init_late();
 
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
@@ -602,8 +602,6 @@ spawnfunc(worldspawn)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
@@ -658,6 +656,7 @@ spawnfunc(worldspawn)
        PlayerStats_GameReport_Init(); // we need this to be initiated before InitGameplayMode
 
        InitGameplayMode();
+       static_init_late();
        readlevelcvars();
        GrappleHookInit();
 
@@ -1426,7 +1425,7 @@ void DumpStats(float final)
                {
                        s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
                        s = strcat(s, ftos(rint(time - other.jointime)), ":");
-                       if(IS_PLAYER(other) || other.caplayer == 1 || g_lms)
+                       if(IS_PLAYER(other) || MUTATOR_CALLHOOK(GetPlayerStatus, other, s))
                                s = strcat(s, ftos(other.team), ":");
                        else
                                s = strcat(s, "spectator:");
@@ -2085,35 +2084,13 @@ void CheckRules_World()
                return;
        }
 
-       float checkrules_status;
-       checkrules_status = WinningCondition_RanOutOfSpawns();
+       int checkrules_status = WinningCondition_RanOutOfSpawns();
        if(checkrules_status == WINNING_YES)
-       {
                bprint("Hey! Someone ran out of spawns!\n");
-       }
-       else if(g_race && !g_race_qualifying && timelimit >= 0)
-       {
-               checkrules_status = WinningCondition_Race(fraglimit);
-               //print("WC_RACE yields ", ftos(checkrules_status), "\n");
-       }
-       else if(g_race && g_race_qualifying == 2 && timelimit >= 0)
-       {
-               checkrules_status = WinningCondition_QualifyingThenRace(fraglimit);
-               //print("WC_QUALIFYING_THEN_RACE yields ", ftos(checkrules_status), "\n");
-       }
-       else if(g_assault)
-       {
-               checkrules_status = WinningCondition_Assault(); // TODO remove this?
-       }
-       else if(g_lms)
-       {
-               checkrules_status = WinningCondition_LMS();
-       }
-       else
-       {
+       else if(!MUTATOR_CALLHOOK(CheckRules_World, checkrules_status, timelimit, fraglimit))
                checkrules_status = WinningCondition_Scores(fraglimit, leadlimit);
-               //print("WC_SCORES yields ", ftos(checkrules_status), "\n");
-       }
+
+       checkrules_status = ret_float;
 
        if(checkrules_status == WINNING_STARTSUDDENDEATHOVERTIME)
        {