From 4d612d8a7958db24fcde7f7b54cfd7a3a6b4ace3 Mon Sep 17 00:00:00 2001 From: Andrew McGuinness Date: Thu, 27 May 2021 09:21:14 +0100 Subject: [PATCH] Do not call AI lost_control for non-AI players --- server/plrhand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/plrhand.c b/server/plrhand.c index d9ccd22d28..f59e09aab8 100644 --- a/server/plrhand.c +++ b/server/plrhand.c @@ -1716,7 +1716,9 @@ void server_remove_player(struct player *pplayer) } /* AI type lost control of this player */ - CALL_PLR_AI_FUNC(lost_control, pplayer, pplayer); + if (pplayer->ai_controlled) { + CALL_PLR_AI_FUNC(lost_control, pplayer, pplayer); + } /* We have to clear all player data before the ai memory is freed because * some function may depend on it. */ -- 2.20.1