-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add storage values to creatures #4495
Conversation
I think the change is beautiful and necessary, however it must be taken into account that all otland scripts will break. otherwise all the above scripts will start leaving -1 in the database |
maybe it's something very stupid, but just adding to compat wouldn't be enough? |
sure, this is probably the way to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why nil instead of -1? 🤔
Trying to sneakily fix this prehistoric fuck up |
Add compatibility functions in compat.lua and you are good to ready 😊 |
I think the way I did it covers everything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
Pull Request Prelude
Changes Proposed
Issues addressed:
Moves storage values up from players to creatures, meaning that monsters and NPCs also get storage values.
Only player storage is saved to the database, since creatures are not stable between server restarts. It could be extended to save NPC storage values, though.
Implementation detail: I opted for an ordered map instead of unordered because
std::unordered_map
uses a lot of memory when empty, as it is optimized for high usage.