vjurenka / BWMirror

BWMirror API source files
Other
55 stars 13 forks source link

game.enemy().getUnits() returns garbage when an initially observed enemy unit goes into FOW #39

Open decisivesacha opened 6 years ago

decisivesacha commented 6 years ago

I have a loop which is the following:

for(Unit unit: game.enemy().getUnits()){
    x = unit.getPosition().getX();
    y = unit.getPosition().getY();
}

When the enemy unit is visible, I get reasonable values for x and y such as (1280, 1104) on a 128x128 map which is 4096x4096 pixels. However, when the enemy unit goes back into the fog of war, the values I receive for x and a y are 32000, 32064. The unit type is unknown and the hit points are zero, however the ID stays the same. Is this the expected behavior? Shouldn't the game only return an enemy unit if the enemy unit if the it is visible to the player?