Created by: nickgal
Smelting doesn't stop when you level up. As it continues smelting you lose ores but do not gain bars.
Step to reproduce
::tp 2973 3370
::skill 13 1
::empty
::item 436 10
::item 438 10
// smelt 10, get 10 bars
::empty
::item 436 10
::item 438 10
// smelt 10 again, it will level up, keep smelting, removing ore but not giving bars
Problem
Leveling up will clear isSmelting
preventing bars for being given but not hitting a condition to break out of the smelting loop.
Fix
Utilize resetSmelting
which, in addition to clearing isSmelting
will cause it to end the smelting at one of these checks:
https://github.com/2006rebotted/2006rebotted/blob/fa167bacd3999efda6c7dff6d3d357cdb0731064/2006Redone%20Server/src/main/java/com/rebotted/game/content/skills/smithing/Smelting.java#L158-L165
Additionally, giving the item before the xp ensures that you receive the bar that levels you up.