Dancing Hoskuld
Deity
No it uses onCityBuilt using modnetmessage. It is in our RoMEventManager.py file in the python folder.
pUnit = CyInterface().getHeadSelectedUnit()
if pUnit:
Then I give you a simple scenario why it will fail miserably.
Give the settler/pioneer/colonist queued orders.
Simply use "Shift", order it to move somewhere and build city.
Or even simpler, move the unit to a plot, make sure its unit movement is totally used up, then click build city.
Obviously, in either case, the unit will not build the city in that turn when it is the Selected Unit.
But after you click end turn, the unit will proceed to automatically build the city.
When that happens, CyInterface().getHeadSelectedUnit() is either invalid or refers to another totally different unit.
Now you see why the code is doomed to fail?
2ndly, what happens when A.I. colonist build the city?
CyInterface().getHeadSelectedUnit() is obviously not refering to the colonist since A.I. does not have a interface obviously.
I am just curious why is a faulty code present in so many mods and nobody ever challenged and ask why