v0.8.0: fixed crashes involving ghouls, and scroll areas not deactivating
This commit is contained in:
parent
b36db88c8c
commit
83def4a4b3
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user