From d2399460b3c5cb4cdc39fbe25d16e55b6bdb91bb Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 27 Sep 2026 23:22:56 +0300
Subject: [PATCH 72/72] Make celebration to affect city outputs on turn it
 begins

Reported by Affy Dal

See RM #1942

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/city.c     | 2 +-
 server/cityturn.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/city.c b/common/city.c
index 7bc06a0ae5..3c3fc20e23 100644
--- a/common/city.c
+++ b/common/city.c
@@ -1693,7 +1693,7 @@ bool base_city_celebrating(const struct city *pcity)
 }
 
 /**********************************************************************//**
-cities celebrate only after consecutive happy turns
+  Cities celebrate only after consecutive happy turns
 **************************************************************************/
 bool city_celebrating(const struct city *pcity)
 {
diff --git a/server/cityturn.c b/server/cityturn.c
index 0965dac9fd..d8f6072474 100644
--- a/server/cityturn.c
+++ b/server/cityturn.c
@@ -3755,6 +3755,7 @@ static void update_city_activity(struct city *pcity)
   struct government *gov;
   bool is_happy;
   bool is_celebrating;
+  bool celebration_change = FALSE;
 
   if (!pcity) {
     return;
@@ -3800,12 +3801,14 @@ static void update_city_activity(struct city *pcity)
         notify_player(pplayer, city_tile(pcity), E_CITY_LOVE, ftc_server,
                       _("Celebrations in your honor in %s."),
                       city_link(pcity));
+        celebration_change = TRUE;
       }
     } else {
       if (pcity->rapture != 0) {
         notify_player(pplayer, city_tile(pcity), E_CITY_NORMAL, ftc_server,
                       _("Celebrations canceled in %s."),
                       city_link(pcity));
+        celebration_change = TRUE;
       }
 
       /* Update city's celebrating counters */
@@ -3835,6 +3838,12 @@ static void update_city_activity(struct city *pcity)
       }
     }
 
+    /* Refresh city again, after happiness calculations.
+     * This makes celebration to affect output on the first turn it happens. */
+    if (celebration_change && city_refresh(pcity)) {
+      auto_arrange_workers(pcity);
+    }
+
     /* City population updated here, after the rapture stuff above. --Jing */
     saved_id = pcity->id;
     pcity->had_famine = FALSE;
-- 
2.53.0

