From b3c912344cf9245f713ff05073f375bb9355a7c6 Mon Sep 17 00:00:00 2001
From: Dino <macwiz23@comcast.net>
Date: Sat, 30 Aug 2025 17:37:00 -0400
Subject: [PATCH 14/14] Pass city anarchy and rapture information to client

Some parts of the patch by Marko Lindqvist

Reported by Affy Dal

See RM #1639
---
 client/packhand.c             | 6 ++++++
 common/networking/packets.def | 3 +++
 server/citytools.c            | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/client/packhand.c b/client/packhand.c
index 5ea2200550..ed37707188 100644
--- a/client/packhand.c
+++ b/client/packhand.c
@@ -866,6 +866,9 @@ void handle_city_info(const struct packet_city_info *packet)
   pcity->was_happy = packet->was_happy;
   pcity->had_famine = packet->had_famine;
 
+  pcity->anarchy = packet->anarchy;
+  pcity->rapture = packet->rapture;
+
   pcity->turn_founded = packet->turn_founded;
   pcity->turn_last_built = packet->turn_last_built;
 
@@ -1279,6 +1282,9 @@ void handle_city_short_info(const struct packet_city_short_info *packet)
   pcity->client.happy = packet->happy;
   pcity->client.unhappy = packet->unhappy;
 
+  pcity->rapture = 0;
+  pcity->anarchy = 0;
+
   improvement_iterate(pimprove) {
     /* Don't update the non-visible improvements, they could hide the
      * previously seen information about the city (diplomat investigation).
diff --git a/common/networking/packets.def b/common/networking/packets.def
index 141ca3d4c1..bccaca066a 100644
--- a/common/networking/packets.def
+++ b/common/networking/packets.def
@@ -769,6 +769,9 @@ PACKET_CITY_INFO = 31; sc, lsend, is-game-info, force, reset(PACKET_CITY_SHORT_I
   BOOL did_buy, did_sell, was_happy;
   BOOL had_famine;
 
+  UINT16 anarchy;
+  UINT16 rapture;
+
   BOOL diplomat_investigate;
   UINT8 walls;
   SINT8 city_image;
diff --git a/server/citytools.c b/server/citytools.c
index 12c5fec86b..5c96b15ee5 100644
--- a/server/citytools.c
+++ b/server/citytools.c
@@ -2698,6 +2698,9 @@ void package_city(struct city *pcity, struct packet_city_info *packet,
   packet->was_happy = pcity->was_happy;
   packet->had_famine = pcity->had_famine;
 
+  packet->anarchy = pcity->anarchy;
+  packet->rapture = pcity->rapture;
+
   packet->walls = city_citywalls_gfx(pcity);
   packet->style = pcity->style;
   packet->city_image = get_city_bonus(pcity, EFT_CITY_IMAGE);
-- 
2.51.0

