Skip to content

Commit

Permalink
document inventory pickup/item merging issue (todo)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreich committed Apr 15, 2017
1 parent b75ce87 commit 19dd212
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/com/ore/infinium/Inventory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,16 @@ open class Inventory

itemToMergeComp.apply {
//merge in the other one, combining items but don't exceed the max these types of items can hold
//fixme whoops this actually drops the extraneous items.
// in other words, the guy gets screwed out of his items
stackSize = (this.stackSize + itemToObsoleteComp.stackSize).coerceAtMost(this.maxStackSize)
//all the other state is fine, because it's already been and still remains in the same spot.
//just count changes
}

itemToObsoleteComp.apply {
stackSize = -1
inventoryIndex = -1
stackSize = -52
inventoryIndex = -52
}
}

Expand Down

0 comments on commit 19dd212

Please sign in to comment.