Thanks Snarko! this approach works. I was so determined to make it work with a Null/none but your way does the job. Use a city as a base then compare the two.
Now I will modify this to cope if the player does not have a city, and cope if there are no cities at all!
then I can have my "isCloseToHome" function which will tell a unit if it is closer to (or as close to) home than a rival city - useful when deciding to pop lairs, negotiate or attack villages, build forts, etc.
EDIT :
OK, I can use CyGame().getNumCities() to tell the total number of cities in game, useful.
But I can't get a city by index to just find the first city and use it as a key?
Now I will modify this to cope if the player does not have a city, and cope if there are no cities at all!
then I can have my "isCloseToHome" function which will tell a unit if it is closer to (or as close to) home than a rival city - useful when deciding to pop lairs, negotiate or attack villages, build forts, etc.
EDIT :
OK, I can use CyGame().getNumCities() to tell the total number of cities in game, useful.
But I can't get a city by index to just find the first city and use it as a key?