fix crash when trying to access to stashPlayerUnits when not in game
This commit is contained in:
@@ -49,6 +49,12 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
|
|||||||
}
|
}
|
||||||
belt := data.Belt{}
|
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 {
|
type socketInfo struct {
|
||||||
item *data.Item
|
item *data.Item
|
||||||
position int // Store X position
|
position int // Store X position
|
||||||
|
|||||||
Reference in New Issue
Block a user