off by one errors sure are nice
the item gets added to the vec before len is calculated, and since its 0-indexed we want to subtract 1
This commit is contained in:
parent
e387bfafba
commit
32d30d38ec
@ -494,7 +494,7 @@ impl CharacterInventory {
|
||||
|
||||
self.items.push(new_stacked_item);
|
||||
if let Some(InventoryItem::Stacked(new_item)) = self.items.last() {
|
||||
Some((new_item, InventorySlot(self.count())))
|
||||
Some((new_item, InventorySlot(self.count()-1)))
|
||||
}
|
||||
else {
|
||||
None
|
||||
|
Loading…
x
Reference in New Issue
Block a user