mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 04:54:05 +09:00
make quickslots work with dynamic items
This commit is contained in:
@@ -202,6 +202,10 @@ class ActorInventory(@Transient val actor: Pocketed, var maxCapacity: Int, var c
|
||||
add(newItem)
|
||||
itemEquipped[newItem.equipPosition] = newItem.dynamicID //invSearchByDynamicID(newItem.dynamicID)!!.item // will test if some sketchy code is written. Test fail: kotlinNullpointerException
|
||||
|
||||
actor.actorValue.getAsInt(AVKey.__PLAYER_QUICKSLOTSEL)?.let {
|
||||
setQuickBar(it, newItem.dynamicID)
|
||||
}
|
||||
|
||||
// FIXME now damage meter (vital) is broken
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -84,7 +84,7 @@ object PlayerBuilderSigrid {
|
||||
|
||||
// item ids are defined in <module>/items/itemid.csv
|
||||
|
||||
inventory.add(8448) // copper pick
|
||||
inventory.add(8448, 16) // copper pick
|
||||
inventory.add(8449) // iron pick
|
||||
inventory.add(8450) // steel pick
|
||||
inventory.add(8466, 9995) // wire piece
|
||||
|
||||
@@ -28,6 +28,14 @@ interface Pocketed {
|
||||
}
|
||||
|
||||
inventory.itemEquipped[item.equipPosition] = null
|
||||
|
||||
// remove it from the quickslot
|
||||
inventory.quickSlot.forEachIndexed { index, itemID ->
|
||||
if (itemID == item.dynamicID) {
|
||||
inventory.setQuickBar(index, null)
|
||||
}
|
||||
}
|
||||
|
||||
item.effectOnUnequip(AppLoader.UPDATE_RATE)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user