Shadowman321
Member
- Joined
- Mar 27, 2010
- Messages
- 205
- Reaction score
- 22
What is the reasoning for this if?
I understand, that default value of -1 is returned if there is no storage defined.
But you can freely set value to other negative negative numbers. But you can't set it to -1.
Is it just some kind of protection, to avoid issues while someone messes up e.g. some quest scripts and set value to -1? Or some more meaning behind this, such as broken logic in other places?
What if I want some specific system that allows negative storage values? I can freely set value like -10. But if someone has +9 points, and gets -10, their score is broken, because its erased when it gets to -1.
forgottenserver/src/player.cpp at e6840b19ddf9e3b1a3795554455318da5e45253b · otland/forgottenserver
A free and open-source MMORPG server emulator written in C++ - otland/forgottenserver
github.com
But you can freely set value to other negative negative numbers. But you can't set it to -1.
Is it just some kind of protection, to avoid issues while someone messes up e.g. some quest scripts and set value to -1? Or some more meaning behind this, such as broken logic in other places?
What if I want some specific system that allows negative storage values? I can freely set value like -10. But if someone has +9 points, and gets -10, their score is broken, because its erased when it gets to -1.