forgottenserver
forgottenserver copied to clipboard
Setting item decay state to 0 doesn't stop duration timer
Before creating an issue, please ensure:
- [x] This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
- [x] This issue is reproducible without changes to the code in this repository
Steps to reproduce (include any configuration/script required to reproduce)
- Start item decay with
item:decay() - Try to set decay state to false (0)
item:setAttribute(ITEM_ATTRIBUTE_DECAYSTATE, 0) - Watch the duration still count down
Expected behaviour
Item duration should stop counting down
Actual behaviour
Item duration still counts down
Environment
Master branch
I made a little workaround that works for now (I know this is redundant code, checking if it's false and setting it to false again)
game.cpp in void Game::checkDecay()
if (!item->canDecay() || item->getDecaying() == DECAYING_FALSE) {
Hmmm that line should probably be that way since it sets decay state to false anyway. Please open a PR.