diff --git a/src/b_bot.h b/src/b_bot.h index a24f07a460..cdcda5b6a2 100644 --- a/src/b_bot.h +++ b/src/b_bot.h @@ -120,8 +120,8 @@ public: void Init (); void End(); bool SpawnBot (const char *name, int color = NOCOLOR); - void TryAddBot (uint8_t **stream, int player); - void RemoveAllBots (bool fromlist); + void TryAddBot (FLevelLocals *Level, uint8_t **stream, int player); + void RemoveAllBots (FLevelLocals *Level, bool fromlist); bool LoadBots (); void ForgetBots (); @@ -153,7 +153,7 @@ public: private: //(b_game.cpp) - bool DoAddBot (uint8_t *info, botskill_t skill); + bool DoAddBot (FLevelLocals *Level, uint8_t *info, botskill_t skill); protected: bool ctf; diff --git a/src/b_game.cpp b/src/b_game.cpp index 3dd90d2249..beed7f3b33 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -340,7 +340,7 @@ bool FCajunMaster::SpawnBot (const char *name, int color) return true; } -void FCajunMaster::TryAddBot (uint8_t **stream, int player) +void FCajunMaster::TryAddBot (FLevelLocals *Level, uint8_t **stream, int player) { int botshift = ReadByte (stream); char *info = ReadString (stream); @@ -363,7 +363,7 @@ void FCajunMaster::TryAddBot (uint8_t **stream, int player) } } - if (DoAddBot ((uint8_t *)info, skill)) + if (DoAddBot (Level,(uint8_t *)info, skill)) { //Increment this. botnum++; @@ -384,7 +384,7 @@ void FCajunMaster::TryAddBot (uint8_t **stream, int player) delete[] info; } -bool FCajunMaster::DoAddBot (uint8_t *info, botskill_t skill) +bool FCajunMaster::DoAddBot (FLevelLocals *Level, uint8_t *info, botskill_t skill) { int bnum; @@ -405,7 +405,7 @@ bool FCajunMaster::DoAddBot (uint8_t *info, botskill_t skill) D_ReadUserInfoStrings (bnum, &info, false); multiplayer = true; //Prevents cheating and so on; emulates real netgame (almost). - players[bnum].Bot = level.CreateThinker(); + players[bnum].Bot = Level->CreateThinker(); players[bnum].Bot->player = &players[bnum]; players[bnum].Bot->skill = skill; playeringame[bnum] = true; @@ -417,11 +417,11 @@ bool FCajunMaster::DoAddBot (uint8_t *info, botskill_t skill) else Printf ("%s joined the game\n", players[bnum].userinfo.GetName()); - level.DoReborn (bnum, true); + Level->DoReborn (bnum, true); return true; } -void FCajunMaster::RemoveAllBots (bool fromlist) +void FCajunMaster::RemoveAllBots (FLevelLocals *Level, bool fromlist) { int i, j; diff --git a/src/d_main.cpp b/src/d_main.cpp index 098eb68768..e835e33a19 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -954,7 +954,7 @@ void D_Display () void D_ErrorCleanup () { savegamerestore = false; - bglobal.RemoveAllBots (true); + bglobal.RemoveAllBots (&level, true); D_QuitNetGame (); if (demorecording || demoplayback) G_CheckDemoStatus (); diff --git a/src/d_net.cpp b/src/d_net.cpp index f062e8ddfe..abd703d133 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2230,11 +2230,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player) break; case DEM_ADDBOT: - bglobal.TryAddBot (stream, player); + bglobal.TryAddBot (&level, stream, player); break; case DEM_KILLBOTS: - bglobal.RemoveAllBots (true); + bglobal.RemoveAllBots (&level, true); Printf ("Removed all bots\n"); break; diff --git a/src/g_game.cpp b/src/g_game.cpp index 6490ab25e3..119e99ee52 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1893,7 +1893,7 @@ void G_DoLoadGame () // Read intermission data for hubs G_SerializeHub(arc); - bglobal.RemoveAllBots(true); + bglobal.RemoveAllBots(&level, true); FString cvar; arc("importantcvars", cvar); diff --git a/src/g_level.cpp b/src/g_level.cpp index 0017d93347..07b98057c1 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1161,7 +1161,7 @@ void FLevelLocals::WorldDone (void) //Added by mc if (deathmatch) { - bglobal.RemoveAllBots(consoleplayer != Net_Arbitrator); + bglobal.RemoveAllBots(this, consoleplayer != Net_Arbitrator); } if (flags & LEVEL_CHANGEMAPCHEAT)