summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ai/ai.c2
-rw-r--r--network_client.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/ai/ai.c b/ai/ai.c
index 42465914d..516a86cc6 100644
--- a/ai/ai.c
+++ b/ai/ai.c
@@ -250,6 +250,8 @@ void AI_LoadAIControl(void)
*/
void AI_StartNewAI(PlayerID player)
{
+ assert(player < MAX_PLAYERS);
+
#ifdef GPMI
/* Keep this in a different IF, because the function can turn _ai.gpmi off!! */
if (_ai.gpmi && _ai.gpmi_mod == NULL)
diff --git a/network_client.c b/network_client.c
index 0f552f4a3..de22bb9e0 100644
--- a/network_client.c
+++ b/network_client.c
@@ -346,8 +346,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
if (index == _network_own_client_index) {
_network_playas = playas;
- /* Are we a ai-network-client? */
- if (_ai.network_client) {
+ /* Are we a ai-network-client? Are we not joining as a SPECTATOR (playas == 0, means SPECTATOR) */
+ if (_ai.network_client && playas != 0) {
if (_ai.network_playas == OWNER_SPECTATOR)
AI_StartNewAI(playas - 1);