Browse Source

[hellfire] Bugfix: Correctly detect nultiple walls

Fixes #2656
pull/2682/head
Anders Jenbo 5 years ago
parent
commit
a95f6b1754
  1. 19
      Source/monster.cpp

19
Source/monster.cpp

@ -2009,29 +2009,22 @@ bool IsTileSafe(const MonsterStruct &monster, Point position)
return true;
}
bool fire = false;
bool lightning = false;
bool fearsFire = (monster.mMagicRes & IMMUNE_FIRE) == 0 || monster.MType->mtype == MT_DIABLO;
bool fearsLightning = (monster.mMagicRes & IMMUNE_LIGHTNING) == 0 || monster.MType->mtype == MT_DIABLO;
for (int j = 0; j < ActiveMissileCount; j++) {
uint8_t mi = ActiveMissiles[j];
auto &missile = Missiles[mi];
if (missile.position.tile == position) {
if (missile._mitype == MIS_FIREWALL) {
fire = true;
break;
if (fearsFire && missile._mitype == MIS_FIREWALL) {
return false;
}
if (missile._mitype == MIS_LIGHTWALL) {
lightning = true;
break;
if (fearsLightning && missile._mitype == MIS_LIGHTWALL) {
return false;
}
}
}
if (fire && ((monster.mMagicRes & IMMUNE_FIRE) == 0 || monster.MType->mtype == MT_DIABLO))
return false;
if (lightning && ((monster.mMagicRes & IMMUNE_LIGHTNING) == 0 || monster.MType->mtype == MT_DIABLO))
return false;
return true;
}

Loading…
Cancel
Save