From b76ff3e3e3159ca97ece2f934f0ece2ca7e6b6d0 Mon Sep 17 00:00:00 2001 From: Andrew McGuinness Date: Wed, 26 May 2021 18:18:55 +0100 Subject: [PATCH] Avoid calling AI lost_control for human players --- ai/tex/texaiplayer.c | 4 ++-- server/plrhand.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ai/tex/texaiplayer.c b/ai/tex/texaiplayer.c index cc1c14d973..45cee1cb15 100644 --- a/ai/tex/texaiplayer.c +++ b/ai/tex/texaiplayer.c @@ -253,7 +253,7 @@ static enum texai_abort_msg_class texai_check_messages(struct ai_type *ait) texai_map_free_recv(); break; default: - log_error("Illegal message type %s (%d) for threaded ai!", + log_error("Illegal message type %s (%d) for tex ai!", texaimsgtype_name(msg->type), msg->type); break; } @@ -341,7 +341,7 @@ void texai_control_lost(struct ai_type *ait, struct player *pplayer) { exthrai.num_players--; - log_debug("%s no longer under threaded AI (%d)", pplayer->name, + log_debug("%s no longer under tex AI (%d)", pplayer->name, exthrai.num_players); if (exthrai.num_players <= 0) { diff --git a/server/plrhand.c b/server/plrhand.c index 1f39f920de..5fd820d09a 100644 --- a/server/plrhand.c +++ b/server/plrhand.c @@ -1814,7 +1814,9 @@ void server_remove_player(struct player *pplayer) } /* AI type lost control of this player */ - CALL_PLR_AI_FUNC(lost_control, pplayer, pplayer); + if (is_ai(pplayer)) { + CALL_PLR_AI_FUNC(lost_control, pplayer, pplayer); + } /* Clear all trade routes. This is needed for the other end not * to point to a city removed by player_clear() */ -- 2.20.1