Bug #2496
openai: doesn't disband ferries causing unhappiness
0%
Description
resolve_city_emergency() disbands the units causing unhappiness when rearranging citizens does not help, but only those with passenger == 0 -- presumably meant to spare a loaded boat. But unfortunately this isn't the right way to check: dai_ferry_init_ferry() sets passenger to FERRY_AVAILABLE (1) on every boat, loaded or not, so no boat is ever disbanded. Thus the AIs attempt to switch to republic/democracy can topple into anarchy all the time - I had a game where the six AI nations averaged 2 overthrows per 3 turns each once they tried to be democracy...
This hurts classic: Republic or Democracy, trireme etc. -- or late-game carrier.
It actually also has implications for civ2civ3: the check is for anything treated as a ferry, which a civ2civ3 helicopter is. Inversely, a Submarine with missiles aboard is not currently considered a ferry, and could be disbanded.
We can't just check FERRY_AVAILABLE either -- a boat which has no passenger-in-control is still FERRY_AVAILABLE, even with many passengers, so we need to check occupancy.
For main and S3_3 the patch factors out dai_ferry_in_use() for it; for S3_2 it is the minimal change in daicity.c.
Files