ranviermud icon indicating copy to clipboard operation
ranviermud copied to clipboard

Item is not removed from ItemManager when player quits

Open marcelomoreli opened this issue 7 years ago • 2 comments

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

marcelomoreli avatar Sep 01 '17 12:09 marcelomoreli

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``

shawncplus avatar Sep 01 '17 17:09 shawncplus

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

shawncplus avatar Sep 01 '17 17:09 shawncplus