mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
fixed a bug where blocks are still consumend even if there is a block already under the cursor
This commit is contained in:
@@ -69,7 +69,7 @@ class ActorInventory() : FixtureInventory() {
|
||||
fun consumeItem(item: GameItem, amount: Long = 1L) {
|
||||
val actor = this.actor as Actor
|
||||
|
||||
if (item.isDynamic && amount != 1L) throw IllegalArgumentException("Dynamic item must be consumed 'once' (expected 1, got $amount)")
|
||||
if (amount < 0) throw IllegalArgumentException("Consuming negative amount of an item (expected >=0, got $amount)")
|
||||
|
||||
if (item.stackable && !item.isDynamic) {
|
||||
remove(item, amount)
|
||||
|
||||
Reference in New Issue
Block a user