• Our Forum Hosts will be doing maintenance sometime in the next 72 hours and you may experience an outage lasting up to 5 minutes.

Is iUnit stable through game save/load?

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
I know it is usually. But I keep seeing bugs in my mod that would be most easily explained by iUnit changing at some point. Possibly but not necessarily at game save/load.

In tests it seem to persist and to be constant with embark/disembark. But I wonder if there is some special circumstance where it changes for some reason. (I'm not expecting it to persist through upgrade... I know that is really a new unit...)
 

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,640
Location
Near Portsmouth, UK
CvUnit::m_iID - which is what is returned by GetID() - is part of the unit's data persisted into the save game file, so yes, it's stable across save/load
 

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
...grrr. I was hoping someone would say "iUnit changes when ... x ... happens". Otherwise the fault must be in my Lua somewhere.
 
Top Bottom