public override void UpdateAfterSimulation() { base.UpdateAfterSimulation(); if (MyPerGameSettings.EnableAi) { PerformBotRemovals(false); AgentSpawnData newBotData; while (m_processQueue.TryDequeue(out newBotData)) { m_agentsToSpawn[newBotData.BotId] = newBotData; Sync.Players.RequestNewPlayer(newBotData.BotId, MyDefinitionManager.Static.GetRandomCharacterName(), newBotData.AgentDefinition.BotModel); } ProfilerShort.Begin("Debug draw"); m_pathfinding.DebugDraw(); m_botCollection.DebugDraw(); ProfilerShort.End(); } }
public override void UpdateAfterSimulation() { base.UpdateAfterSimulation(); if (MyPerGameSettings.EnableAi) { if (m_removeQueue.Count > 0) { foreach (var playerNumber in m_removeQueue) { MyPlayer player = Sync.Players.TryGetPlayerById(new MyPlayer.PlayerId(MySteam.UserId, playerNumber)); Sync.Players.RemovePlayer(player); } m_removeQueue.Clear(); } ProfilerShort.Begin("Debug draw"); m_pathfinding.DebugDraw(); m_botCollection.DebugDraw(); ProfilerShort.End(); } }