From 83def4a4b3363557176d33ba42cac711125f1673 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 4 Feb 2020 14:58:53 -0500 Subject: [PATCH] v0.8.0: fixed crashes involving ghouls, and scroll areas not deactivating --- .../src/main/java/com/watabou/noosa/ScrollArea.java | 9 ++++++++- .../shatteredpixeldungeon/actors/mobs/Ghoul.java | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/SPD-classes/src/main/java/com/watabou/noosa/ScrollArea.java b/SPD-classes/src/main/java/com/watabou/noosa/ScrollArea.java index 22edb23a2..4158df8be 100644 --- a/SPD-classes/src/main/java/com/watabou/noosa/ScrollArea.java +++ b/SPD-classes/src/main/java/com/watabou/noosa/ScrollArea.java @@ -40,7 +40,14 @@ public class ScrollArea extends PointerArea { private Signal.Listener scrollListener = new Signal.Listener() { @Override public boolean onSignal(ScrollEvent event) { - if (event != null && target.overlapsScreenPoint( (int)event.pos.x, (int)event.pos.y )){ + + boolean hit = event != null && target.overlapsScreenPoint( (int)event.pos.x, (int)event.pos.y ); + + if (!isActive()) { + return (hit && blockWhenInactive); + } + + if (hit){ onScroll( event ); return true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java index 141d92503..027a898bc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java @@ -42,8 +42,8 @@ public class Ghoul extends Mob { { spriteClass = GhoulSprite.class; - HP = HT = 45; - defenseSkill = 20; + HP = HT = 5; + defenseSkill = 0; EXP = 5; maxLvl = 20; @@ -340,6 +340,10 @@ public class Ghoul extends Mob { for (Char ch : Actor.chars()){ if (ch != dieing && ch instanceof Ghoul && ch.alignment == dieing.alignment){ + if (ch.fieldOfView == null){ + ch.fieldOfView = new boolean[Dungeon.level.length()]; + Dungeon.level.updateFieldOfView( ch, ch.fieldOfView ); + } if (ch.fieldOfView[dieing.pos] || Dungeon.level.distance(ch.pos, dieing.pos) < 4){ return (Ghoul) ch; }