Merge pull request #21 from kwader2k/fix-crash-when-accessing-to-stashPlayerUnits

Fix crash when accessing to stash player units when not in game
This commit is contained in:
guiyomu-dev
2025-10-31 16:30:52 +01:00
committed by GitHub

View File

@@ -49,6 +49,12 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
}
belt := data.Belt{}
// Early return if not in-game to avoid any crash
if mainPlayer.Area == 0 {
inventory.Belt = belt
return inventory
}
type socketInfo struct {
item *data.Item
position int // Store X position