Afforess
The White Wizard
Doesn't that need to be persisted though (across the save and reload)?
The last used ID (m_iCurrentID) is already persisted. With the loading line I removed, the iLastId = -1, so when the array goes to allocate it, it will have to a full scan to find the next open spot. Maybe you were just trying to improve performance?
That's my understanding of it. I admit, I am not a professional C++ programmer...mostly Java/Ruby these days.