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)

This commit is contained in:
Evan Debenham 2014-10-03 15:56:47 -04:00
parent ba8d158ba7
commit 6c818ec0b1
2 changed files with 16 additions and 8 deletions

View File

@ -133,10 +133,11 @@ public class Wandmaker extends Mob.NPC {
} }
} else { } else {
tell( Quest.alternative ? TXT_DUST1 : TXT_BERRY1 );
Quest.given = true;
Quest.placeItem(); Quest.placeItem();
if (Quest.given)
tell(Quest.alternative ? TXT_DUST1 : TXT_BERRY1);
Journal.add( Journal.Feature.WANDMAKER ); Journal.add( Journal.Feature.WANDMAKER );
} }
@ -287,10 +288,13 @@ public class Wandmaker extends Mob.NPC {
while (Dungeon.level.heaps.get( pos ) != null) { while (Dungeon.level.heaps.get( pos ) != null) {
pos = Dungeon.level.randomRespawnCell(); pos = Dungeon.level.randomRespawnCell();
} }
Heap heap = Dungeon.level.drop( new CorpseDust(), pos ); if (pos != -1) {
heap.type = Heap.Type.SKELETON; Heap heap = Dungeon.level.drop(new CorpseDust(), pos);
heap.sprite.link(); heap.type = Heap.Type.SKELETON;
heap.sprite.link();
given = true;
}
} }
} else { } else {
@ -299,7 +303,11 @@ public class Wandmaker extends Mob.NPC {
while (Dungeon.level.heaps.get( shrubPos ) != null) { while (Dungeon.level.heaps.get( shrubPos ) != null) {
shrubPos = Dungeon.level.randomRespawnCell(); shrubPos = Dungeon.level.randomRespawnCell();
} }
Dungeon.level.plant( new Rotberry.Seed(), shrubPos );
if (shrubPos != -1) {
Dungeon.level.plant(new Rotberry.Seed(), shrubPos);
given = true;
}
} }
} }

View File

@ -551,7 +551,7 @@ public abstract class RegularLevel extends Level {
while (true) { while (true) {
if (++count > 10) { if (++count > 30) {
return -1; return -1;
} }