]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Revert "Merge branch 'TimePath/bot_api' into 'master'\r"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index da2983c4a20d98cbaba575bbfd87005f22004938..a0f9a3f131ab2e2552340692736ad82fd398d324 100644 (file)
 #include "race.qh"
 #include "scores.qh"
 #include "teamplay.qh"
-#include "waypointsprites.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.qh"
+#include "../common/effects/effects.qh"
 #include "../common/mapinfo.qh"
 #include "../common/monsters/all.qh"
 #include "../common/monsters/sv_monsters.qh"
-#include "../common/vehicles/vehicles.qh"
+#include "../common/vehicles/all.qh"
 #include "../common/notifications.qh"
 #include "../common/playerstats.qh"
 #include "../common/stats.qh"
@@ -42,7 +41,7 @@ const float LATENCY_THINKRATE = 10;
 .float latency_time;
 entity pingplreport;
 void PingPLReport_Think()
-{
+{SELFPARAM();
        float delta;
        entity e;
 
@@ -118,7 +117,7 @@ void SetDefaultAlpha()
 }
 
 void GotoFirstMap()
-{
+{SELFPARAM();
        float n;
        if(autocvar__sv_init)
        {
@@ -147,7 +146,7 @@ void GotoFirstMap()
        else
        {
                self.nextthink = time + 1;
-               print("Waiting for _sv_init being set to 1 by initialization scripts...\n");
+               LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...\n");
        }
 }
 
@@ -336,7 +335,6 @@ void cvar_changes_init()
                BADCVAR("pausable");
                BADCVAR("sv_allow_fullbright");
                BADCVAR("sv_checkforpacketsduringsleep");
-               BADCVAR("sv_fraginfo");
                BADCVAR("sv_timeout");
                BADPREFIX("sv_timeout_");
                BADPREFIX("crypto_");
@@ -347,12 +345,13 @@ void cvar_changes_init()
                BADPREFIX("prvm_");
                BADPREFIX("skill_");
                BADPREFIX("sv_cullentities_");
-               BADPREFIX("sv_fraginfo_");
                BADPREFIX("sv_maxidle_");
                BADPREFIX("sv_vote_");
                BADPREFIX("timelimit_");
                BADCVAR("gameversion");
                BADPREFIX("gameversion_");
+               BADCVAR("sv_minigames");
+               BADPREFIX("sv_minigames_");
                BADCVAR("sv_namechangetimer");
 
                // allowed changes to server admins (please sync this to server.cfg)
@@ -504,7 +503,7 @@ void detect_maptype()
                        tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, world);
        if(trace_fraction == 1)
                continue;
-                       print(ftos(i), " -> ", vtos(trace_endpos), "\n");
+                       LOG_INFO(ftos(i), " -> ", vtos(trace_endpos), "\n");
                }
 
                break;
@@ -513,33 +512,29 @@ void detect_maptype()
 }
 
 entity randomseed;
-float RandomSeed_Send(entity to, int sf)
+bool RandomSeed_Send(entity this, entity to, int sf)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
        WriteShort(MSG_ENTITY, self.cnt);
        return true;
 }
 void RandomSeed_Think()
-{
+{SELFPARAM();
        self.cnt = bound(0, floor(random() * 65536), 65535);
        self.nextthink = time + 5;
 
        self.SendFlags |= 1;
 }
 void RandomSeed_Spawn()
-{
+{SELFPARAM();
        randomseed = spawn();
        randomseed.think = RandomSeed_Think;
        Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
 
-       entity oldself;
-       oldself = self;
-       self = randomseed;
-       self.think(); // sets random seed and nextthink
-       self = oldself;
+       WITH(entity, self, randomseed, randomseed.think()); // sets random seed and nextthink
 }
 
-void spawnfunc___init_dedicated_server(void)
+spawnfunc(__init_dedicated_server)
 {
        // handler for _init/_init map (only for dedicated server initialization)
 
@@ -564,8 +559,6 @@ void spawnfunc___init_dedicated_server(void)
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
-       CALL_ACCUMULATED_FUNCTION(RegisterEffects);
-       CALL_ACCUMULATED_FUNCTION(RegisterVehicles);
 
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
@@ -574,12 +567,11 @@ void spawnfunc___init_dedicated_server(void)
 void Map_MarkAsRecent(string m);
 float world_already_spawned;
 void Nagger_Init();
-void Item_ItemsTime_Init();
 void ClientInit_Spawn();
 void WeaponStats_Init();
 void WeaponStats_Shutdown();
 void Physics_AddStats();
-void spawnfunc_worldspawn (void)
+spawnfunc(worldspawn)
 {
        float fd, l, j, n;
        string s;
@@ -613,8 +605,6 @@ void spawnfunc_worldspawn (void)
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
-       CALL_ACCUMULATED_FUNCTION(RegisterEffects);
-       CALL_ACCUMULATED_FUNCTION(RegisterVehicles);
 
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
@@ -668,7 +658,6 @@ void spawnfunc_worldspawn (void)
 
        PlayerStats_GameReport_Init(); // we need this to be initiated before InitGameplayMode
 
-       precache_model ("null"); // we need this one before InitGameplayMode
        InitGameplayMode();
        readlevelcvars();
        GrappleHookInit();
@@ -699,10 +688,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");
@@ -757,23 +742,23 @@ void spawnfunc_worldspawn (void)
                                        continue;
                                if(argv(0) == "cd")
                                {
-                                       print("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
-                                       print("  cdtrack ", argv(2), "\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
+                                       LOG_INFO("  cdtrack ", argv(2), "\n");
                                }
                                else if(argv(0) == "fog")
                                {
-                                       print("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
-                                       print("  \"fog\" \"", s, "\"\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
+                                       LOG_INFO("  \"fog\" \"", s, "\"\n");
                                }
                                else if(argv(0) == "set")
                                {
-                                       print("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
-                                       print("  clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
+                                       LOG_INFO("  clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
                                }
                                else if(argv(0) != "//")
                                {
-                                       print("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
-                                       print("  clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
+                                       LOG_INFO("  clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
                                }
                        }
                        fclose(fd);
@@ -814,19 +799,6 @@ void spawnfunc_worldspawn (void)
 
        addstat(STAT_ARC_HEAT, AS_FLOAT, arc_heat_percent);
 
-       // items time
-       addstat(STAT_ARMOR_LARGE_TIME, AS_FLOAT, item_armor_large_time);
-       addstat(STAT_HEALTH_MEGA_TIME, AS_FLOAT, item_health_mega_time);
-       addstat(STAT_INVISIBLE_TIME, AS_FLOAT, item_invisible_time);
-       addstat(STAT_SPEED_TIME, AS_FLOAT, item_speed_time);
-       addstat(STAT_EXTRALIFE_TIME, AS_FLOAT, item_extralife_time);
-       addstat(STAT_STRENGTH_TIME, AS_FLOAT, item_strength_time);
-       addstat(STAT_SHIELD_TIME, AS_FLOAT, item_shield_time);
-       addstat(STAT_FUELREGEN_TIME, AS_FLOAT, item_fuelregen_time);
-       addstat(STAT_JETPACK_TIME, AS_FLOAT, item_jetpack_time);
-       addstat(STAT_SUPERWEAPONS_TIME, AS_FLOAT, item_superweapons_time);
-       Item_ItemsTime_Init();
-
        // freeze attacks
        addstat(STAT_FROZEN, AS_INT, frozen);
        addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress);
@@ -940,7 +912,7 @@ void spawnfunc_worldspawn (void)
        world_initialized = 1;
 }
 
-void spawnfunc_light (void)
+spawnfunc(light)
 {
        //makestatic (self); // Who the f___ did that?
        remove(self);
@@ -987,39 +959,39 @@ float MapHasRightSize(string map)
        if(currentbots || autocvar_bot_number || player_count < autocvar_minplayers)
        if(autocvar_g_maplist_check_waypoints)
        {
-               dprint("checkwp "); dprint(map);
+               LOG_TRACE("checkwp "); LOG_TRACE(map);
                if(!fexists(strcat("maps/", map, ".waypoints")))
                {
-                       dprint(": no waypoints\n");
+                       LOG_TRACE(": no waypoints\n");
                        return false;
                }
-               dprint(": has waypoints\n");
+               LOG_TRACE(": has waypoints\n");
        }
 
        // open map size restriction file
-       dprint("opensize "); dprint(map);
+       LOG_TRACE("opensize "); LOG_TRACE(map);
        fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
        if(fh >= 0)
        {
                float mapmin, mapmax;
-               dprint(": ok, ");
+               LOG_TRACE(": ok, ");
                mapmin = stof(fgets(fh));
                mapmax = stof(fgets(fh));
                fclose(fh);
                if(player_count < mapmin)
                {
-                       dprint("not enough\n");
+                       LOG_TRACE("not enough\n");
                        return false;
                }
                if(player_count > mapmax)
                {
-                       dprint("too many\n");
+                       LOG_TRACE("too many\n");
                        return false;
                }
-               dprint("right size\n");
+               LOG_TRACE("right size\n");
                return true;
        }
-       dprint(": not found\n");
+       LOG_TRACE(": not found\n");
        return true;
 }
 
@@ -1028,22 +1000,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)));
@@ -1074,7 +1030,7 @@ float Map_Check(float position, float pass)
                return 0;
        }
        else
-               dprint( "Couldn't select '", filename, "'..\n" );
+               LOG_TRACE( "Couldn't select '", filename, "'..\n" );
 
        return 0;
 }
@@ -1107,7 +1063,7 @@ float() MaplistMethod_Iterate = // usual method
 {
        float pass, i;
 
-       dprint("Trying MaplistMethod_Iterate\n");
+       LOG_TRACE("Trying MaplistMethod_Iterate\n");
 
        for(pass = 1; pass <= 2; ++pass)
        {
@@ -1124,7 +1080,7 @@ float() MaplistMethod_Iterate = // usual method
 
 float() MaplistMethod_Repeat = // fallback method
 {
-       dprint("Trying MaplistMethod_Repeat\n");
+       LOG_TRACE("Trying MaplistMethod_Repeat\n");
 
        if(Map_Check(Map_Current, 2))
                return Map_Current;
@@ -1135,7 +1091,7 @@ float() MaplistMethod_Random = // random map selection
 {
        float i, imax;
 
-       dprint("Trying MaplistMethod_Random\n");
+       LOG_TRACE("Trying MaplistMethod_Random\n");
 
        imax = 42;
 
@@ -1155,7 +1111,7 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
 {
        float i, j, imax, insertpos;
 
-       dprint("Trying MaplistMethod_Shuffle\n");
+       LOG_TRACE("Trying MaplistMethod_Shuffle\n");
 
        imax = 42;
 
@@ -1167,7 +1123,7 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
                insertpos = pow(random(), 1 / exponent);       // ]0, 1]
                insertpos = insertpos * (Map_Count - 1);       // ]0, Map_Count - 1]
                insertpos = ceil(insertpos) + 1;               // {2, 3, 4, ..., Map_Count}
-               dprint("SHUFFLE: insert pos = ", ftos(insertpos), "\n");
+               LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos), "\n");
 
                // insert the current map there
                newlist = "";
@@ -1333,7 +1289,7 @@ When the player presses attack or jump, change to the next level
 */
 .float autoscreenshot;
 void IntermissionThink()
-{
+{SELFPARAM();
        FixIntermissionClient(self);
 
        float server_screenshot = (autocvar_sv_autoscreenshot && self.cvar_cl_autoscreenshot);
@@ -1443,7 +1399,7 @@ void DumpStats(float final)
        s = strcat(s, GetGametype(), "_", GetMapname(), ":", ftos(rint(time)));
 
        if(to_console)
-               print(s, "\n");
+               LOG_INFO(s, "\n");
        if(to_eventlog)
                GameLogEcho(s);
 
@@ -1459,7 +1415,7 @@ void DumpStats(float final)
 
        s = strcat(":labels:player:", GetPlayerScoreString(world, 0));
        if(to_console)
-               print(s, "\n");
+               LOG_INFO(s, "\n");
        if(to_eventlog)
                GameLogEcho(s);
        if(to_file)
@@ -1477,7 +1433,7 @@ void DumpStats(float final)
                                s = strcat(s, "spectator:");
 
                        if(to_console)
-                               print(s, other.netname, "\n");
+                               LOG_INFO(s, other.netname, "\n");
                        if(to_eventlog)
                                GameLogEcho(strcat(s, ftos(other.playerid), ":", other.netname));
                        if(to_file)
@@ -1489,7 +1445,7 @@ void DumpStats(float final)
        {
                s = strcat(":labels:teamscores:", GetTeamScoreString(0, 0));
                if(to_console)
-                       print(s, "\n");
+                       LOG_INFO(s, "\n");
                if(to_eventlog)
                        GameLogEcho(s);
                if(to_file)
@@ -1500,7 +1456,7 @@ void DumpStats(float final)
                        s = strcat(":teamscores:see-labels:", GetTeamScoreString(i, 0));
                        s = strcat(s, ":", ftos(i));
                        if(to_console)
-                               print(s, "\n");
+                               LOG_INFO(s, "\n");
                        if(to_eventlog)
                                GameLogEcho(s);
                        if(to_file)
@@ -1509,7 +1465,7 @@ void DumpStats(float final)
        }
 
        if(to_console)
-               print(":end\n");
+               LOG_INFO(":end\n");
        if(to_eventlog)
                GameLogEcho(":end");
        if(to_file)
@@ -1610,7 +1566,7 @@ Exit deathmatch games upon conditions
 ============
 */
 void CheckRules_Player()
-{
+{SELFPARAM();
        if (gameover)   // someone else quit the game already
                return;
 
@@ -1705,53 +1661,11 @@ void ClearWinners(void)
                head.winning = 0;
 }
 
-// Onslaught winning condition:
-// game terminates if only one team has a working generator (or none)
-float WinningCondition_Onslaught()
-{
-       entity head;
-       float t1, t2, t3, t4;
-
-       WinningConditionHelper(); // set worldstatus
-
-       if(warmup_stage)
-               return WINNING_NO;
-
-       // first check if the game has ended
-       t1 = t2 = t3 = t4 = 0;
-       head = find(world, classname, "onslaught_generator");
-       while (head)
-       {
-               if (head.health > 0)
-               {
-                       if (head.team == NUM_TEAM_1) t1 = 1;
-                       if (head.team == NUM_TEAM_2) t2 = 1;
-                       if (head.team == NUM_TEAM_3) t3 = 1;
-                       if (head.team == NUM_TEAM_4) t4 = 1;
-               }
-               head = find(head, classname, "onslaught_generator");
-       }
-       if (t1 + t2 + t3 + t4 < 2)
-       {
-               // game over, only one team remains (or none)
-               ClearWinners();
-               if (t1) SetWinners(team, NUM_TEAM_1);
-               if (t2) SetWinners(team, NUM_TEAM_2);
-               if (t3) SetWinners(team, NUM_TEAM_3);
-               if (t4) SetWinners(team, NUM_TEAM_4);
-               dprint("Have a winner, ending game.\n");
-               return WINNING_YES;
-       }
-
-       // Two or more teams remain
-       return WINNING_NO;
-}
-
 // Assault winning condition: If the attackers triggered a round end (by fulfilling all objectives)
 // they win. Otherwise the defending team wins once the timelimit passes.
 void assault_new_round();
 float WinningCondition_Assault()
-{
+{SELFPARAM();
        float status;
 
        WinningConditionHelper(); // set worldstatus
@@ -1784,11 +1698,7 @@ float WinningCondition_Assault()
                        }
                        else
                        {
-                               entity oldself;
-                               oldself = self;
-                               self = ent;
-                               assault_new_round();
-                               self = oldself;
+                               WITH(entity, self, ent, assault_new_round());
                        }
                }
        }
@@ -1856,7 +1766,7 @@ float WinningCondition_LMS()
                {
                        // SNAFU (maybe a draw game?)
                        ClearWinners();
-                       dprint("No players, ending game.\n");
+                       LOG_TRACE("No players, ending game.\n");
                        return WINNING_YES;
                }
        }
@@ -1912,7 +1822,7 @@ float WinningCondition_Scores(float limit, float leadlimit)
        if(WinningConditionHelper_zeroisworst)
                leadlimit = 0; // not supported in this mode
 
-       if(g_dm || g_tdm || g_ca || g_freezetag || (g_race && !g_race_qualifying) || g_nexball)
+       if(MUTATOR_CALLHOOK(Scores_CountFragsRemaining))
        // these modes always score in increments of 1, thus this makes sense
        {
                if(leaderfrags != WinningConditionHelper_topscore)
@@ -2115,9 +2025,6 @@ void CheckRules_World()
                return;
        }
 
-       if(g_onslaught)
-               timelimit = 0; // ONS has its own overtime rule
-
        float wantovertime;
        wantovertime = 0;
 
@@ -2203,10 +2110,6 @@ void CheckRules_World()
        {
                checkrules_status = WinningCondition_LMS();
        }
-       else if (g_onslaught)
-       {
-               checkrules_status = WinningCondition_Onslaught(); // TODO remove this?
-       }
        else
        {
                checkrules_status = WinningCondition_Scores(fraglimit, leadlimit);
@@ -2266,19 +2169,20 @@ string GotoMap(string m)
 
 
 void EndFrame()
-{
+{SELFPARAM();
        anticheat_endframe();
 
        float altime;
-       FOR_EACH_REALCLIENT(self)
+       entity e_;
+       FOR_EACH_REALCLIENT(e_)
        {
-               entity e = IS_SPEC(self) ? self.enemy : self;
+               entity e = IS_SPEC(e_) ? e_.enemy : e_;
                if(e.typehitsound)
-                       self.typehit_time = time;
+                       e_.typehit_time = time;
                else if(e.damage_dealt)
                {
-                       self.hit_time = time;
-                       self.damage_dealt_total += ceil(e.damage_dealt);
+                       e_.hit_time = time;
+                       e_.damage_dealt_total += ceil(e.damage_dealt);
                }
        }
        altime = time + frametime * (1 + autocvar_g_antilag_nudge);
@@ -2287,14 +2191,18 @@ void EndFrame()
        // add another frametime because client shows everything with
        // 1 frame of lag (cl_nolerp 0). The last +1 however should not be
        // needed!
-       FOR_EACH_CLIENT(self)
+       FOR_EACH_CLIENT(e_)
+       {
+               e_.typehitsound = false;
+               e_.damage_dealt = 0;
+               setself(e_);
+               antilag_record(e_, altime);
+       }
+       FOR_EACH_MONSTER(e_)
        {
-               self.typehitsound = false;
-               self.damage_dealt = 0;
-               antilag_record(self, altime);
+               setself(e_);
+               antilag_record(e_, altime);
        }
-       FOR_EACH_MONSTER(self)
-               antilag_record(self, altime);
 }
 
 
@@ -2305,7 +2213,7 @@ void EndFrame()
 float redirection_timeout;
 float redirection_nextthink;
 float RedirectionThink()
-{
+{SELFPARAM();
        float clients_found;
 
        if(redirection_target == "")
@@ -2327,10 +2235,12 @@ float RedirectionThink()
        redirection_nextthink = time + 1;
 
        clients_found = 0;
-       FOR_EACH_REALCLIENT(self)
+       entity e;
+       FOR_EACH_REALCLIENT(e)
        {
+               setself(e);
                // TODO add timer
-               print("Redirecting: sending connect command to ", self.netname, "\n");
+               LOG_INFO("Redirecting: sending connect command to ", self.netname, "\n");
                if(redirection_target == "self")
                        stuffcmd(self, "\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " reconnect\n");
                else
@@ -2338,7 +2248,7 @@ float RedirectionThink()
                ++clients_found;
        }
 
-       print("Redirecting: ", ftos(clients_found), " clients left.\n");
+       LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.\n");
 
        if(time > redirection_timeout || clients_found == 0)
                localcmd("\nwait; wait; wait; quit\n");
@@ -2371,7 +2281,7 @@ void Shutdown()
        if(world_initialized > 0)
        {
                world_initialized = 0;
-               print("Saving persistent data...\n");
+               LOG_INFO("Saving persistent data...\n");
                Ban_SaveBans();
 
                // playerstats with unfinished match
@@ -2394,7 +2304,7 @@ void Shutdown()
                CheatShutdown(); // must be after cheatcount check
                db_close(ServerProgsDB);
                db_close(TemporaryDB);
-               print("done!\n");
+               LOG_INFO("done!\n");
                // tell the bot system the game is ending now
                bot_endgame();
 
@@ -2403,6 +2313,6 @@ void Shutdown()
        }
        else if(world_initialized == 0)
        {
-               print("NOTE: crashed before even initializing the world, not saving persistent data\n");
+               LOG_INFO("NOTE: crashed before even initializing the world, not saving persistent data\n");
        }
 }