From 6c818ec0b17bc31f050792f170caaab5c4837212 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 3 Oct 2014 15:56:47 -0400 Subject: [PATCH] V0.2.1: Corrected bug involving failed item placement with Wandmaker quest (bug is also present with ghost, will be fixed in ghost quest overhaul shortly) --- .../actors/mobs/npcs/Wandmaker.java | 22 +++++++++++++------ .../levels/RegularLevel.java | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index 965a66466..b9f4acbf1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -133,10 +133,11 @@ public class Wandmaker extends Mob.NPC { } } else { - tell( Quest.alternative ? TXT_DUST1 : TXT_BERRY1 ); - Quest.given = true; Quest.placeItem(); + + if (Quest.given) + tell(Quest.alternative ? TXT_DUST1 : TXT_BERRY1); Journal.add( Journal.Feature.WANDMAKER ); } @@ -287,10 +288,13 @@ public class Wandmaker extends Mob.NPC { while (Dungeon.level.heaps.get( pos ) != null) { pos = Dungeon.level.randomRespawnCell(); } - - Heap heap = Dungeon.level.drop( new CorpseDust(), pos ); - heap.type = Heap.Type.SKELETON; - heap.sprite.link(); + + if (pos != -1) { + Heap heap = Dungeon.level.drop(new CorpseDust(), pos); + heap.type = Heap.Type.SKELETON; + heap.sprite.link(); + given = true; + } } } else { @@ -299,7 +303,11 @@ public class Wandmaker extends Mob.NPC { while (Dungeon.level.heaps.get( shrubPos ) != null) { shrubPos = Dungeon.level.randomRespawnCell(); } - Dungeon.level.plant( new Rotberry.Seed(), shrubPos ); + + if (shrubPos != -1) { + Dungeon.level.plant(new Rotberry.Seed(), shrubPos); + given = true; + } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index fc7c88172..8a9f037fe 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -551,7 +551,7 @@ public abstract class RegularLevel extends Level { while (true) { - if (++count > 10) { + if (++count > 30) { return -1; }