From 31bcd5896e3ff4ea358682dc13a2d9fb76573cd3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 6 Dec 2022 09:09:41 +0200 Subject: [PATCH 48/48] Disable server side CMA when overridden See osdn #46213 Signed-off-by: Marko Lindqvist --- server/cityhand.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/cityhand.c b/server/cityhand.c index c0b5e95f5d..96915b410d 100644 --- a/server/cityhand.c +++ b/server/cityhand.c @@ -143,6 +143,9 @@ void handle_city_make_specialist(struct player *pplayer, return; } + /* Disable server side governor being overridden */ + handle_web_cma_clear(pplayer, pcity->id); + if (is_free_worked(pcity, ptile)) { auto_arrange_workers(pcity); } else if (tile_worked(ptile) == pcity) { @@ -187,6 +190,9 @@ void handle_city_make_worker(struct player *pplayer, } if (is_free_worked(pcity, ptile)) { + /* Disable server side governor being overridden */ + handle_web_cma_clear(pplayer, pcity->id); + auto_arrange_workers(pcity); sync_cities(); return; @@ -210,6 +216,9 @@ void handle_city_make_worker(struct player *pplayer, return; } + /* Disable server side governor being overridden */ + handle_web_cma_clear(pplayer, pcity->id); + city_map_update_worker(pcity, ptile); specialist_type_iterate(i) { @@ -558,7 +567,7 @@ void handle_web_cma_clear(struct player *pplayer, int id) { struct city *pcity = player_city_by_number(pplayer, id); - if (pcity != NULL) { + if (pcity != NULL && pcity->cm_parameter != NULL) { free(pcity->cm_parameter); pcity->cm_parameter = NULL; send_city_info(pplayer, pcity); -- 2.35.1