If you want the old IDs to be used again, by other monsters/players, then you can implement some kind of structure to hold the already used IDs in the monster/player-class. In the CWorldServer-class you have to have an identical structure to hold the IDs there's currently used.
* Player have an ID (1001)
* Monster have an ID (1002)
** CWorldServer now knows the IDs there are used (1001, 1002)
* Monster kills Player, and the used Player ID is saved in the Player-class
** The Player ID is now deleted in CWorldServers currently used IDs (1002)
** CWorldServer gives Player a new ID, but first it checks that it isn't in the Players used-IDs (1001), so CWorldServer gives it a new ID (1003)
* Now Player have a new
Think about that one "star" (*) is something there's going on in the monster/player class and two "stars" (**) is something there's going on in the CWorldServer class. I hope you get the idea of it.
It's pretty hard, as you see, to help you exactly. Can you maybe come with an more detailed/complex example of what you're trying to do?
|