So I've come to rely on the isNone() functions/methods in for the various Cy classes to rule out possible issues with non-valid instances. But what exactly do these check?
Because I'm currently having issues with checking unit scriptData; A CyUnit instance that would get recognized as "None" is also returning an empty string with CyUnit.getScriptData(). This would of course seem like a good feature, if it weren't for the fact that those units are alive and well - stomping around the game map!
They haven't been killed in combat or disbanded, but they will none-the-less temporarily register as "None". (The next turn, or another turn down the line, they are mostly back as valid instances again.) This is causing issues for me as I'm trying to locate these units by looking up their scriptData strings. My code is either not recognizing the units (with a isNone() check) or unable to fetch the scriptData (which would be an empty string value).
What exactly makes a CyUnit instance become "None" - and be valid again on the next turn? This assuming that the unit haven't been killed and thus the vacant slot being "None" before it is once again occupied by a valid CyUnit instance.
Oh, and the units all have UNITAI_EXPLORE - next up I will change this to NO_UNITAI just to rule out any problems with that...
Because I'm currently having issues with checking unit scriptData; A CyUnit instance that would get recognized as "None" is also returning an empty string with CyUnit.getScriptData(). This would of course seem like a good feature, if it weren't for the fact that those units are alive and well - stomping around the game map!

What exactly makes a CyUnit instance become "None" - and be valid again on the next turn? This assuming that the unit haven't been killed and thus the vacant slot being "None" before it is once again occupied by a valid CyUnit instance.
Oh, and the units all have UNITAI_EXPLORE - next up I will change this to NO_UNITAI just to rule out any problems with that...