v2.0.0: fixed rare cases where a hero out of enemy FOV couldn't surprise

This commit is contained in:
Evan Debenham
2022-12-28 19:10:29 -05:00
parent 1e0ee1eca9
commit a7a0a7e51f

View File

@@ -678,8 +678,8 @@ public abstract class Mob extends Char {
public boolean surprisedBy( Char enemy, boolean attacking ){ public boolean surprisedBy( Char enemy, boolean attacking ){
return enemy == Dungeon.hero return enemy == Dungeon.hero
&& (enemy.invisible > 0 || !enemySeen) && (enemy.invisible > 0 || !enemySeen || (fieldOfView != null && !fieldOfView[enemy.pos]))
&& (!attacking || ((Hero)enemy).canSurpriseAttack()); && (!attacking || enemy.canSurpriseAttack());
} }
public void aggro( Char ch ) { public void aggro( Char ch ) {