Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item is not removed from ItemManager when player quits #269

Open
marcelomoreli opened this issue Sep 1, 2017 · 2 comments
Open

Item is not removed from ItemManager when player quits #269

marcelomoreli opened this issue Sep 1, 2017 · 2 comments

Comments

@marcelomoreli
Copy link
Contributor

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

@shawncplus
Copy link
Member

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
Copy link
Member

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 shawncplus added this to the v3.0.0 milestone Sep 20, 2017
@shawncplus shawncplus removed this from the v3.0.0 milestone Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants