You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the auto refill belt option is enabled, scrolls will still be consumed from the belt instead of the inventory. Potions work as expected.
To Reproduce
Set the Auto Refill Belt option on.
Place a scroll in your inventory. Place one in your belt.
Use the scroll in the belt.
Expected Behavior
The inventory item should be consumed rather than the belt item.
Additional context
The code in inv.cpp::UseInvItem that sets the player.queuedSpell.spellFrom value should be changed to use the newly calculated index (c) rather than the passed in index (cii) to allow either the found inventory item to be used, or the last item in the belt (if present). However, the calculated index (c) also needs to be reset as an offset from the baseline inv_item as expected by inv.cpp::ConsumeScroll.
if (speedlist) {
if (player.SpdList[c]._iMiscId == IMISC_NOTE) {
InitQTextMsg(TEXT_BOOK9);
CloseInventory();
return true;
}
if (!item->isScroll() && !item->isRune())
player.RemoveSpdBarItem(c);
else
player.queuedSpell.spellFrom = cii; <---- OLD
player.queuedSpell.spellFrom = INVITEM_BELT_FIRST + c; <---- NEW
return true;
}
if (player.InvList[c]._iMiscId == IMISC_MAPOFDOOM)
return true;
if (player.InvList[c]._iMiscId == IMISC_NOTE) {
InitQTextMsg(TEXT_BOOK9);
CloseInventory();
return true;
}
if (!item->isScroll() && !item->isRune())
player.RemoveInvItem(c);
else
player.queuedSpell.spellFrom = cii; <---- OLD
player.queuedSpell.spellFrom = INVITEM_INV_FIRST + c; <---- NEW
return true;
The text was updated successfully, but these errors were encountered:
manapixel
changed the title
Scrolls do not auto refill on the belt properly
Scrolls do not auto refill the belt properly
Dec 15, 2022
Operating System
Linux x64
DevilutionX version
1.4.1 (latest release)
Describe
If the auto refill belt option is enabled, scrolls will still be consumed from the belt instead of the inventory. Potions work as expected.
To Reproduce
Set the Auto Refill Belt option on.
Place a scroll in your inventory. Place one in your belt.
Use the scroll in the belt.
Expected Behavior
The inventory item should be consumed rather than the belt item.
Additional context
The code in inv.cpp::UseInvItem that sets the player.queuedSpell.spellFrom value should be changed to use the newly calculated index (c) rather than the passed in index (cii) to allow either the found inventory item to be used, or the last item in the belt (if present). However, the calculated index (c) also needs to be reset as an offset from the baseline inv_item as expected by inv.cpp::ConsumeScroll.
The text was updated successfully, but these errors were encountered: