From 6ee1d98b269056d2152a6c623cb67cc6ec6d1cfe Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 28 Aug 2022 16:47:27 +0300 Subject: [PATCH 56/56] Limit new player from civil war to max rates more accurately See osdn #44187 Signed-off-by: Marko Lindqvist --- server/plrhand.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/plrhand.c b/server/plrhand.c index 635fcedc3a..a9bbe4eaa7 100644 --- a/server/plrhand.c +++ b/server/plrhand.c @@ -2712,6 +2712,10 @@ static struct player *split_player(struct player *pplayer) if (!cplayer) { return NULL; } + + /* While this sets player->economic according to max rates as know at this point, + * we redo that later, so that MaxRates effect requirements will be evaluated + * with more completely set up player (e.g. correct government) */ server_player_init(cplayer, TRUE, TRUE); /* Rebel will always be an AI player */ @@ -2834,6 +2838,8 @@ static struct player *split_player(struct player *pplayer) CALL_PLR_AI_FUNC(split_by_civil_war, pplayer, pplayer, cplayer); CALL_PLR_AI_FUNC(created_by_civil_war, cplayer, pplayer, cplayer); + cplayer->economic = player_limit_to_max_rates(cplayer); + return cplayer; } -- 2.35.1