v0.8.0: fixed crashes involving ghouls, and scroll areas not deactivating

This commit is contained in:
Evan Debenham 2020-02-04 14:58:53 -05:00
parent b36db88c8c
commit 83def4a4b3
2 changed files with 14 additions and 3 deletions

View File

@ -40,7 +40,14 @@ public class ScrollArea extends PointerArea {
private Signal.Listener<ScrollEvent> scrollListener = new Signal.Listener<ScrollEvent>() {
@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;
}

View File

@ -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;
}