Skip to content

Commit

Permalink
Fix error with mods on Client because IBotGame was not being instanti…
Browse files Browse the repository at this point in the history
…ated
  • Loading branch information
paulov-t committed May 7, 2024
1 parent 6343f59 commit a4e7ff3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Source/Coop/SITGameModes/CoopSITGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -948,19 +948,17 @@ public override IEnumerator vmethod_4(float startDelay, BotControllerSettings co
Logger.LogDebug("Bot Spawner System has been turned off - You are running as Client");
}

if (!SITMatchmaking.IsClient)
{

var nonwaves = (WaveInfo[])ReflectionHelpers.GetFieldFromTypeByFieldType(nonWavesSpawnScenario_0.GetType(), typeof(WaveInfo[])).GetValue(nonWavesSpawnScenario_0);

BotsPresets profileCreator =
var nonwaves = (WaveInfo[])ReflectionHelpers.GetFieldFromTypeByFieldType(nonWavesSpawnScenario_0.GetType(), typeof(WaveInfo[])).GetValue(nonWavesSpawnScenario_0);
BotsPresets profileCreator =
new(BackEndSession
, wavesSpawnScenario_0.SpawnWaves
, this.BossWaves
, nonwaves
, true);
BotCreator botCreator = new(this, profileCreator, CreatePhysicalBot);

BotCreator botCreator = new(this, profileCreator, CreatePhysicalBot);
if (!SITMatchmaking.IsClient)
{
BotZone[] botZones = LocationScene.GetAllObjects<BotZone>(false).ToArray();
PBotsController.Init(this
, botCreator
Expand Down Expand Up @@ -1014,6 +1012,10 @@ public override IEnumerator vmethod_4(float startDelay, BotControllerSettings co
Logger.LogError(ex);
}
}
else
{
PBotsController.Init(this, botCreator, [], SpawnSystem, wavesSpawnScenario_0.BotLocationModifier, false, false, false, false, false, Singleton<GameWorld>.Instance, "");
}

yield return new WaitForSeconds(startDelay);

Expand Down

0 comments on commit a4e7ff3

Please sign in to comment.