Does this actually work in game ? I wonder... Anyhow, as soon as you activate or get one of the units out of the city, something will get lost somewhere.
Yes, it does work. But only for human player, for fortified units, starting from 2nd (first F unit skipped), and only if unit in its home city. Tested it just now. 3 militias in London. Fortified all of 3. 2 went to special fields.
Also "celebration cancelled" flag in JCivED actually is used as flag "unit was moved from special field" and this is its
only purpose
.
Game tries to move units FROM special fields to normal unit array when: 1) city screen of this city is shown or 2) some unit is activated or moves to a next square - then game checks if there are any cities in 8 squares around the unit, and if civ of city is not same as the civ of the unit, then game tries to move units from special fields of this city to a normal unit array. If game failed to do this, unit(s) still will disappear from special field(s) and "Sire, our population cannot..." message will appear. City flag 4 is set to 1 here. If it fails,
only unit(s) from the special field(s) will disappear. Main unit array will be alright.
Game tries to move units TO the special fields when:
1) unit changes its status from "freshly fortified" to "fortified" and there's no any enemy units around (in 8 adjacent squares)
2) in city logic, after paying for maintenance of city improvements, if there's no any enemy units around (in 8 adj. squares). In this case, game also checks if city flag 4 is not 0, which means that this city already moved unit from special field to normal status before.
City flag 4 is set to 0 here.
Maybe should add pastebin with some C about put in/put out logic later.