From 9a75c60c3e0aadad6e45ba7f760312e9a560d615 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 27 Nov 2022 22:06:24 +0200 Subject: [PATCH 33/33] Client: Clip wall value from PACKET_SHORT_CITY to NUM_WALL_TYPES Based on report by Lexxie See osdn #46092 Signed-off-by: Marko Lindqvist --- client/packhand.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/packhand.c b/client/packhand.c index 8758ccd0c2..9d4121d48a 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -1245,6 +1245,9 @@ void handle_city_short_info(const struct packet_city_short_info *packet) } } pcity->client.walls = packet->walls; + if (pcity->client.walls > NUM_WALL_TYPES) { + pcity->client.walls = NUM_WALL_TYPES; + } pcity->style = packet->style; pcity->capital = packet->capital; if (packet->capital == CAPITAL_PRIMARY) { -- 2.35.1