Skip to content

Commit

Permalink
Merge pull request #56 from Luk-ESC/master
Browse files Browse the repository at this point in the history
Fix `set_slot` armor indexing (Off-by-one error)
  • Loading branch information
Snowiiii authored Aug 22, 2024
2 parents 84464c3 + d85e9bc commit d0db720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pumpkin-inventory/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl PlayerInventory {
1..=4 => self.crafting[slot - 1] = item,
5..=8 => {
match item {
None => self.armor[slot - 4] = None,
None => self.armor[slot - 5] = None,
Some(item) => {
// TODO: Replace asserts with error handling
match slot - 5 {
Expand Down

0 comments on commit d0db720

Please sign in to comment.