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