Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IBotGame not existing on client #312

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Source/Coop/SITGameModes/CoopSITGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
base.vmethod_1(timeBeforeDeploy);
}

public static async Task<ISpawnPoint?> SendOrReceiveSpawnPoint(ISpawnPoint selectedSpawnPoint, SpawnPoints spawnPoints)

Check warning on line 538 in Source/Coop/SITGameModes/CoopSITGame.cs

View workflow job for this annotation

GitHub Actions / Build-SIT (Debug)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
var position = selectedSpawnPoint.Position;
if (!SITMatchmaking.IsClient)
Expand Down Expand Up @@ -948,19 +948,17 @@
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 @@
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
Loading