forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Setting item decay state to 0 doesn't stop duration timer

Open infernumx opened this issue 8 years ago • 1 comments

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)

  1. Start item decay with item:decay()
  2. Try to set decay state to false (0) item:setAttribute(ITEM_ATTRIBUTE_DECAYSTATE, 0)
  3. 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) {

infernumx avatar Feb 19 '17 04:02 infernumx

Hmmm that line should probably be that way since it sets decay state to false anyway. Please open a PR.

ranisalt avatar Feb 19 '17 05:02 ranisalt