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 ad8b46fcf..4785e8fee 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 @@ -238,8 +238,6 @@ public class Ghoul extends Mob { @Override public boolean act() { - ghoul.sprite.visible = Dungeon.level.heroFOV[ghoul.pos]; - if (target.alignment != ghoul.alignment){ detach(); return true; @@ -302,6 +300,12 @@ public class Ghoul extends Mob { return true; } + public void updateVisibility(){ + if (ghoul != null && ghoul.sprite != null){ + ghoul.sprite.visible = Dungeon.level.heroFOV[ghoul.pos]; + } + } + public void set(int turns, Ghoul ghoul){ this.ghoul = ghoul; turnsToRevive = turns; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index ed2370b81..c37e45bc5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DemonSpawner; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Ghoul; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Snake; import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites; @@ -1243,6 +1244,11 @@ public class GameScene extends PixelScene { if (scene != null) { for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { if (mob.sprite != null) mob.sprite.visible = Dungeon.level.heroFOV[mob.pos]; + if (mob instanceof Ghoul){ + for (Ghoul.GhoulLifeLink link : mob.buffs(Ghoul.GhoulLifeLink.class)){ + link.updateVisibility(); + } + } } } }