v0.7.1a: added safety checks to blacksmith and bones

This commit is contained in:
Evan Debenham 2018-12-20 21:29:39 -05:00
parent 5b6bacc627
commit 77e712003c
2 changed files with 5 additions and 1 deletions

View File

@ -139,6 +139,8 @@ public class Bones {
if (depth == Dungeon.depth && Dungeon.challenges == 0) {
FileUtils.deleteFile( BONES_FILE );
depth = 0;
if (item == null) return null;
//Enforces artifact uniqueness
if (item instanceof Artifact){

View File

@ -200,7 +200,9 @@ public class Blacksmith extends NPC {
}
first.level(first.level()+1); //prevents on-upgrade effects like enchant/glyph removal
if (first instanceof MissileWeapon && !Dungeon.hero.belongings.contains(first)) {
first.collect();
if (!first.collect()){
Dungeon.level.drop( first, Dungeon.hero.pos );
}
}
Dungeon.hero.spendAndNext( 2f );
Badges.validateItemLevelAquired( first );