v0.5.0b: added a safety check to stop fog of war from being updated out of bounds

This commit is contained in:
Evan Debenham 2017-02-18 20:32:53 -05:00
parent 762bddccc0
commit 96989edb32

View File

@ -127,6 +127,7 @@ public class FogOfWar extends Image {
public synchronized void updateFogArea(int x, int y, int w, int h){
updated.union(x, y);
updated.union(x + w, y + h);
updated = updated.intersect( new Rect(0, 0, mapWidth, mapHeight) );
}
public synchronized void moveToUpdating(){