v2.0.0: fixed disarming traps rarely teleporting into containers
This commit is contained in:
+6
-2
@@ -50,11 +50,15 @@ public class DisarmingTrap extends Trap{
|
|||||||
Heap heap = Dungeon.level.heaps.get( pos );
|
Heap heap = Dungeon.level.heaps.get( pos );
|
||||||
|
|
||||||
if (heap != null && heap.type == Heap.Type.HEAP){
|
if (heap != null && heap.type == Heap.Type.HEAP){
|
||||||
int cell = Dungeon.level.randomRespawnCell( null );
|
|
||||||
|
|
||||||
Item item = heap.pickUp();
|
int cell;
|
||||||
|
do {
|
||||||
|
cell = Dungeon.level.randomRespawnCell(null);
|
||||||
|
} while (cell != -1 && Dungeon.level.heaps.get( pos ) != null
|
||||||
|
&& Dungeon.level.heaps.get( pos ).type != Heap.Type.HEAP);
|
||||||
|
|
||||||
if (cell != -1) {
|
if (cell != -1) {
|
||||||
|
Item item = heap.pickUp();
|
||||||
Heap dropped = Dungeon.level.drop( item, cell );
|
Heap dropped = Dungeon.level.drop( item, cell );
|
||||||
dropped.seen = true;
|
dropped.seen = true;
|
||||||
if (item instanceof Honeypot.ShatteredPot){
|
if (item instanceof Honeypot.ShatteredPot){
|
||||||
|
|||||||
Reference in New Issue
Block a user