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

Inventory becomes null on purpose #51

Open
shawncplus opened this issue Feb 14, 2019 · 2 comments
Open

Inventory becomes null on purpose #51

shawncplus opened this issue Feb 14, 2019 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@shawncplus
Copy link
Member

Removing the last item from a Character's inventory intentionally sets the inventory to null. The comment in the code seems to indicate this is to prevent the case where an NPC has a default inventory, then during gameplay has its items removed, then is serialized, then is hydrated, and we needed a way to tell the difference between "This NPC had all of its items removed and should still have an empty inventory" and "This NPC has never had its default inventory setup and needs the items spawned"

I think this is irrelevant given that NPCs are never saved/rehydrated. And even if they were I would let someone else deal with that issue. We should no longer unset Character inventory when removing the last item, it creates way too many issues

@shawncplus shawncplus added the bug Something isn't working label Feb 14, 2019
@markscho
Copy link
Contributor

Ha, I just noticed this too. At the very least, if you wanted to keep the feature, I would think that you'd just create a new property on the Inventory class to keep track of this. But I really don't think there's any pressing need to keep it.

@shawncplus shawncplus added this to the 3.2 milestone Aug 22, 2019
azigler added a commit to azigler/core that referenced this issue Jun 6, 2020
@azigler
Copy link

azigler commented Jun 7, 2020

I've addressed this in #121.

azigler added a commit to azigler/core that referenced this issue Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants