NP, figured it out because of the spawn_range map.
I have 3 possible solutions, and to be honest all will take some work. All refer to the spawn_list in the zone server as that should be the master list that controls spawns
1. Switch the list to smart pointers, note that this is a c++11 feature so not all compilers will support it
2. When a spawn is deleted, before the actual delete go through all possible lists that could contain a reference to it and check to see if any of them have a reference, if they do set it to 0
3. Change the list to a map<int32, Spawn*>, the int32 being a unique id > 0, and have every thing outside the zone server point to the id instead of the spawn pointer and when they need the spawn pointer call a function to get the pointer
Code: Select all
Spawn* ZoneServer::GetSpawn(int32 id)
I think 3 is probably the best solution, one of my original ideas and seems to be how EQEmu does it, will be supported by all versions of c++ (unlike option 1) and no chance of us missing a reference (probably a high chance of missing one with option2).
I will play around with some of this to see how much work it will actually take but what is every one else's thoughts on this?
Side notes:
This should probably be split off and moved to server bugs, also EQEmu moved to CMake and git???? WTF!!! guess I won't be screwing with their source any more