v2.0.0: fixed rare cases where a hero out of enemy FOV couldn't surprise
This commit is contained in:
@@ -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 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user