From 9b5af93f7fa51e0143a40850ed2ffc5d17bdf91a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 10 Apr 2021 02:20:56 +0300 Subject: [PATCH 27/27] Fix server crash when illness destroys a city See osdn #41959 Signed-off-by: Marko Lindqvist --- server/cityturn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/cityturn.c b/server/cityturn.c index dd71f277a2..d090ef7a96 100644 --- a/server/cityturn.c +++ b/server/cityturn.c @@ -3158,7 +3158,11 @@ static void update_city_activity(struct city *pcity) notify_player(pplayer, city_tile(pcity), E_CITY_PLAGUE, ftc_server, _("%s has been struck by a plague! Population lost!"), city_link(pcity)); - city_reduce_size(pcity, 1, NULL, "plague"); + if (!city_reduce_size(pcity, 1, NULL, "plague")) { + /* City destroyed completely. */ + return; + } + pcity->turn_plague = game.info.turn; /* recalculate illness */ -- 2.30.2