sometimes the player is already loaded in memory but the map still not ready yet, so wait for it

This commit is contained in:
Héctor Giménez
2024-05-20 21:29:15 +09:00
parent b685ee4c05
commit 52bb744b9b

View File

@@ -65,9 +65,9 @@ func (gd *GameReader) GetData() data.Data {
} }
func (gd *GameReader) InGame() bool { func (gd *GameReader) InGame() bool {
playerUnits := gd.GetRawPlayerUnits() player := gd.GetRawPlayerUnits().GetMainPlayer()
return playerUnits.GetMainPlayer().UnitID > 0 return player.UnitID > 0 && player.Position.X > 0 && player.Position.Y > 0 && player.Area > 0
} }
func (gd *GameReader) openMenus() data.OpenMenus { func (gd *GameReader) openMenus() data.OpenMenus {