From 2611125adf25f17f0991cb806f8121d68f663510 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 19 Jan 2017 18:56:26 -0500 Subject: [PATCH] v0.5.0: tapping on heap sprites now overrides the tile location of that tap --- .../shatteredpixeldungeon/scenes/CellSelector.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java index bd5446082..3b6f9c4bd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; @@ -61,6 +62,13 @@ public class CellSelector extends TouchArea { return; } } + + for (Heap heap : Dungeon.level.heaps.values()){ + if (heap.sprite != null && heap.sprite.overlapsPoint( p.x, p.y)){ + select( heap.pos ); + return; + } + } select( ((DungeonTilemap)target).screenToTile( (int)touch.current.x,