mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
did i fix the crafting-unequip bug?
This commit is contained in:
@@ -295,6 +295,8 @@ class UICraftingWorkbench(val inventoryUI: UIInventoryFull?, val parentContainer
|
|||||||
|
|
||||||
|
|
||||||
if (itemCraftable) {
|
if (itemCraftable) {
|
||||||
|
val itemEquippedBefore = player.itemEquipped[GameItem.EquipPosition.HAND_GRIP]
|
||||||
|
|
||||||
itemListIngredients.getInventory().forEach { (itm, qty) ->
|
itemListIngredients.getInventory().forEach { (itm, qty) ->
|
||||||
player.remove(itm, qty * craftMult)
|
player.remove(itm, qty * craftMult)
|
||||||
}
|
}
|
||||||
@@ -304,6 +306,11 @@ class UICraftingWorkbench(val inventoryUI: UIInventoryFull?, val parentContainer
|
|||||||
resetUI() // also clears forcehighlightlist
|
resetUI() // also clears forcehighlightlist
|
||||||
playerThings.rebuild(FILTER_CAT_ALL)
|
playerThings.rebuild(FILTER_CAT_ALL)
|
||||||
itemListCraftable.rebuild(FILTER_CAT_ALL)
|
itemListCraftable.rebuild(FILTER_CAT_ALL)
|
||||||
|
|
||||||
|
// preserve equipped item
|
||||||
|
if (itemEquippedBefore != null && player.searchByID(itemEquippedBefore) != null) {
|
||||||
|
player.itemEquipped[GameItem.EquipPosition.HAND_GRIP] = itemEquippedBefore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
refreshCraftButtonStatus()
|
refreshCraftButtonStatus()
|
||||||
|
|||||||
Reference in New Issue
Block a user