From c04920630a31fa8fdc0c92c3d73ca004d4b8e0cf Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 6 Mar 2025 11:36:31 -0500 Subject: [PATCH] v3.0.1: fixed crashes when stasised scorpio ally is aggroed on new floor --- .../shatteredpixeldungeon/actors/mobs/GnollTrickster.java | 4 +++- .../shatteredpixeldungeon/actors/mobs/Scorpio.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java index 2fa2e8aa1..ac01c05a3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java @@ -107,7 +107,9 @@ public class GnollTrickster extends Gnoll { @Override public void aggro(Char ch) { //cannot be aggroed to something it can't see - if (ch == null || fieldOfView == null || fieldOfView[ch.pos]) { + //skip this check if FOV isn't initialized + if (ch == null || fieldOfView == null + || fieldOfView.length != Dungeon.level.length() || fieldOfView[ch.pos]) { super.aggro(ch); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java index 209f459b0..865088d22 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java @@ -97,7 +97,9 @@ public class Scorpio extends Mob { @Override public void aggro(Char ch) { //cannot be aggroed to something it can't see - if (ch == null || fieldOfView == null || fieldOfView[ch.pos]) { + //skip this check if FOV isn't initialized + if (ch == null || fieldOfView == null + || fieldOfView.length != Dungeon.level.length() || fieldOfView[ch.pos]) { super.aggro(ch); } }