]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Merge branch 'TimePath/bot_api' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index b5a2806d76d7a5756ad55a656c29951f8dd23514..b202f284f6b664903899c35c0514824928592481 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "anticheat.qh"
 #include "antilag.qh"
-#include "bot/bot.qh"
 #include "campaign.qh"
 #include "cheats.qh"
 #include "cl_client.qh"
@@ -19,7 +18,7 @@
 #include "scores.qh"
 #include "teamplay.qh"
 #include "weapons/weaponstats.qh"
-#include "../common/buffs.qh"
+#include "../common/buffs/all.qh"
 #include "../common/constants.qh"
 #include "../common/deathtypes.qh"
 #include "../common/effects/effects.qh"
@@ -512,8 +511,8 @@ void detect_maptype()
 }
 
 entity randomseed;
-float RandomSeed_Send(entity to, int sf)
-{SELFPARAM();
+bool RandomSeed_Send(entity this, entity to, int sf)
+{
        WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
        WriteShort(MSG_ENTITY, self.cnt);
        return true;
@@ -534,8 +533,8 @@ void RandomSeed_Spawn()
        WITH(entity, self, randomseed, randomseed.think()); // sets random seed and nextthink
 }
 
-void spawnfunc___init_dedicated_server(void)
-{SELFPARAM();
+spawnfunc(__init_dedicated_server)
+{
        // handler for _init/_init map (only for dedicated server initialization)
 
        world_initialized = -1; // don't complain
@@ -557,7 +556,6 @@ void spawnfunc___init_dedicated_server(void)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterTurrets);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
@@ -572,8 +570,8 @@ void ClientInit_Spawn();
 void WeaponStats_Init();
 void WeaponStats_Shutdown();
 void Physics_AddStats();
-void spawnfunc_worldspawn (void)
-{SELFPARAM();
+spawnfunc(worldspawn)
+{
        float fd, l, j, n;
        string s;
 
@@ -604,12 +602,9 @@ void spawnfunc_worldspawn (void)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterTurrets);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
-       initialize_minigames();
-
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
        TemporaryDB = db_create();
@@ -692,10 +687,6 @@ void spawnfunc_worldspawn (void)
                MUTATOR_CALLHOOK(BuildMutatorsString, s);
                s = ret_string;
 
-               // simple, probably not good in the mutator system
-               if(autocvar_g_grappling_hook)
-                       s = strcat(s, ":grappling_hook");
-
                // initialiation stuff, not good in the mutator system
                if(!autocvar_g_use_ammunition)
                        s = strcat(s, ":no_use_ammunition");
@@ -920,8 +911,8 @@ void spawnfunc_worldspawn (void)
        world_initialized = 1;
 }
 
-void spawnfunc_light (void)
-{SELFPARAM();
+spawnfunc(light)
+{
        //makestatic (self); // Who the f___ did that?
        remove(self);
 }
@@ -1008,22 +999,6 @@ string Map_Filename(float position)
        return strcat("maps/", argv(position), ".bsp");
 }
 
-string strwords(string s, float w)
-{
-       float endpos;
-       for(endpos = 0; w && endpos >= 0; --w)
-               endpos = strstrofs(s, " ", endpos + 1);
-       if(endpos < 0)
-               return s;
-       else
-               return substring(s, 0, endpos);
-}
-
-float strhasword(string s, string w)
-{
-       return strstrofs(strcat(" ", s, " "), strcat(" ", w, " "), 0) >= 0;
-}
-
 void Map_MarkAsRecent(string m)
 {
        cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));