Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we spawn a monster, we increment the count on the monster object for the entry into the spawnedmap. When we remove the monster from the spawnedmap because of it being outside the zone, we don't decrement the ref count, which leads to a leak.
There is also extra logic in place for a spawn ID 0. Not sure why monsters were being removed from the spawned map and placed back into it with 0 as the id for when they leave the area, but I find no other interactions or checks for spawn id being 0, so there seems to be zero reason, and whatever was so special about spawn id 0 doesn't exist anymore, so I cleaned up that old code that has not been in use since apparently before TFS was TFS.
Pull Request Prelude
Changes Proposed
remove dead code
Issues addressed:
Memory leak
Overspawn