ranviermud
ranviermud copied to clipboard
Item is not removed from ItemManager when player quits
I noticed that when the user quits the game, the item is not removed from the ItemManager so, when you quit and enter again, you'll have two items with same uuid on ItemManager
Notes to self: Npc#hydrate
and Player#hydrate
both add hydrated items to the ItemManager
but there is no process to remove them if the player is removed from the game. The best approach will probably be for NPCs: update add a new unload()
method to NPC (or something named like that) that is then called from Area#removeNpc
, the method will do the work of removing any carried items from the game and any additional cleanup.
For Players a similar method will need to be added then called from `PlayerManager#removePlayer``
Possibly as well it'd be a good idea to make ItemManager
a Map instead of a Set since it should never be possible to have two items in the game with the same UUID