fix: crafting an item could unequip any holding item

This commit is contained in:
minjaesong
2024-09-12 20:53:04 +09:00
parent ff16ca5b1a
commit 4a0f740e03

View File

@@ -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)
}
}