From 96989edb32e10a7227bff0f9fe2fe7b78fe28c33 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 18 Feb 2017 20:32:53 -0500 Subject: [PATCH] v0.5.0b: added a safety check to stop fog of war from being updated out of bounds --- .../com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java index 33ce0be27..127af0168 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java @@ -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(){