mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 19:41:30 +00:00
Fix infinite loops
This commit is contained in:
parent
aabf7b9b5a
commit
a6f5571750
@ -5653,14 +5653,18 @@ void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust)
|
||||
auto fac = (*iter)->GetReverseFactionCon(this);
|
||||
if (beneficial_targets) {
|
||||
// only affect mobs we would assist.
|
||||
if (!(fac <= FACTION_AMIABLE))
|
||||
if (!(fac <= FACTION_AMIABLE)) {
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// affect mobs that are on our hate list, or which have bad faction with us
|
||||
if (!(CheckAggro(*iter) || fac == FACTION_THREATENLY || fac == FACTION_SCOWLS))
|
||||
if (!(CheckAggro(*iter) || fac == FACTION_THREATENLY || fac == FACTION_SCOWLS)) {
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# shortest distance from line to target point
|
||||
float d = std::abs((*iter)->GetY() - m * (*iter)->GetX() - b) / sqrt(m * m + 1);
|
||||
@ -5721,14 +5725,18 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust)
|
||||
auto fac = (*iter)->GetReverseFactionCon(this);
|
||||
if (beneficial_targets) {
|
||||
// only affect mobs we would assist.
|
||||
if (!(fac <= FACTION_AMIABLE))
|
||||
if (!(fac <= FACTION_AMIABLE)) {
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// affect mobs that are on our hate list, or which have bad faction with us
|
||||
if (!(CheckAggro(*iter) || fac == FACTION_THREATENLY || fac == FACTION_SCOWLS))
|
||||
if (!(CheckAggro(*iter) || fac == FACTION_THREATENLY || fac == FACTION_SCOWLS)) {
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (angle_start > angle_end) {
|
||||
if ((heading_to_target >= angle_start && heading_to_target <= 360.0f) ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user