From ab7163d1114673ae31a0a93ab01d94bf5e46d007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Gim=C3=A9nez?= Date: Wed, 2 Oct 2024 23:13:17 +0900 Subject: [PATCH] calculate inventory matrix based on current inv items - fix --- pkg/data/items.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/data/items.go b/pkg/data/items.go index 5a4ed90..f5080e9 100644 --- a/pkg/data/items.go +++ b/pkg/data/items.go @@ -61,10 +61,9 @@ func (i Inventory) Matrix() [4][10]bool { invMatrix := [4][10]bool{} // false = empty, true = occupied for _, itm := range i.ByLocation(item.LocationInventory) { for k := range itm.Desc().InventoryWidth { - invMatrix[itm.Position.Y][itm.Position.X+k] = true - } - for k := range itm.Desc().InventoryHeight { - invMatrix[itm.Position.Y+k][itm.Position.X] = true + for j := range itm.Desc().InventoryHeight { + invMatrix[itm.Position.Y+j][itm.Position.X+k] = true + } } }