mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
fix: crafting an item could unequip any holding item
This commit is contained in:
@@ -74,11 +74,13 @@ class ActorInventory() : FixtureInventory() {
|
|||||||
* e.g. re-assign after this operation */
|
* e.g. re-assign after this operation */
|
||||||
override fun remove(item: GameItem, count: Long): Long {
|
override fun remove(item: GameItem, count: Long): Long {
|
||||||
return super.remove(item, count) { existingItem ->
|
return super.remove(item, count) { existingItem ->
|
||||||
|
|
||||||
// unequip, if applicable
|
// unequip, if applicable
|
||||||
actor.unequipItem(existingItem.itm)
|
actor.unequipItem(existingItem.itm)
|
||||||
// also unequip on the quickslot
|
// also unequip on the quickslot
|
||||||
actor.actorValue.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL)?.let {
|
actor.actorValue.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL)?.let {
|
||||||
setQuickslotItem(it, null)
|
if (quickSlot[it] != null && quickSlot[it] == existingItem.itm)
|
||||||
|
setQuickslotItem(it, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user