From b98ed1d0717caf8ef49cb63d8ab4ce0646351060 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 29 Feb 2020 02:21:07 -0500 Subject: [PATCH] v0.8.0: fixed the following: - wards displacing items for sale or in containers - rare crash bugs when DK dies on his throne - capitalization error in health boost buff name --- .../shatteredpixeldungeon/actors/mobs/DwarfKing.java | 8 +++++--- .../shatteredpixeldungeon/actors/mobs/npcs/NPC.java | 2 +- .../shatteredpixeldungeon/messages/items/items.properties | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java index 6f01d9988..4273bd5aa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java @@ -421,10 +421,12 @@ public class DwarfKing extends Mob { if (Dungeon.level.solid[pos]){ Heap h = Dungeon.level.heaps.get(pos); - for (Item i : h.items){ - Dungeon.level.drop(i, pos + Dungeon.level.width()); + if (h != null) { + for (Item i : h.items) { + Dungeon.level.drop(i, pos + Dungeon.level.width()); + } + h.destroy(); } - h.destroy(); Dungeon.level.drop(new ArmorKit(), pos + Dungeon.level.width()).sprite.drop(pos); } else { Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java index 8678e2e1e..2cf798549 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java @@ -39,7 +39,7 @@ public abstract class NPC extends Mob { protected void throwItem() { Heap heap = Dungeon.level.heaps.get( pos ); - if (heap != null) { + if (heap != null && heap.type == Heap.Type.HEAP) { int n; do { n = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index e97241873..a616226d4 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -688,7 +688,7 @@ items.potions.elixirs.elixirofmight.name=elixir of might items.potions.elixirs.elixirofmight.msg_1=+1 str, +%d hp items.potions.elixirs.elixirofmight.msg_2=Newfound strength surges through your body. items.potions.elixirs.elixirofmight.desc=This powerful liquid will course through your muscles, permanently increasing your strength by one point and temporarily increasing maximum health by %d points. The health boost scales with your maximum health, but will slowly wear off as you gain levels. -items.potions.elixirs.elixirofmight$htboost.name=max health boost +items.potions.elixirs.elixirofmight$htboost.name=Max Health Boost items.potions.elixirs.elixirofmight$htboost.desc=Your body feels unnaturally strong and healthy.\n\nYour maximum health is boosted for an extended period of time. As you gain levels, the boost will steadily fade.\n\nCurrent boost amount: %d\nLevels remaining: %d items.potions.elixirs.elixiroftoxicessence.name=elixir of toxic essence