public void BotRequest(int connectionId) { MobileAgent _ma = agents.Find(x => ((x.user != null) ? x.user.connectionId : x.customId) == connectionId); if (_ma != null && agents[0] == _ma && !isStarted && canAddBots && agents.Count < MapLoader.maps[map].minPlayers && agents.FindAll(x => x.heroType == HeroType.Player).Count < MapLoader.maps[_ma.session.map].maxPlayers && !killed) { AISpawner.SpawnPlayerBot(ServerManager.playerHeroes [Random.Range(0, ServerManager.playerHeroes.Count)].clientPrefab, this); } }