mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +00:00
[BugFix] Remove potential nullptrs in Virus Code (#1658)
This commit is contained in:
@@ -5237,6 +5237,11 @@ std::vector<Mob*> EntityList::GetTargetsForVirusEffect(Mob *spreader, Mob *origi
|
||||
bool is_detrimental_spell = IsDetrimentalSpell(spell_id);
|
||||
for (auto &it : entity_list.GetCloseMobList(spreader, range)) {
|
||||
Mob *mob = it.second;
|
||||
|
||||
if (!mob) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mob == spreader) {
|
||||
continue;
|
||||
}
|
||||
@@ -5259,6 +5264,10 @@ std::vector<Mob*> EntityList::GetTargetsForVirusEffect(Mob *spreader, Mob *origi
|
||||
// Make sure the target is in range
|
||||
if (mob->CalculateDistance(spreader->GetX(), spreader->GetY(), spreader->GetZ()) <= range) {
|
||||
|
||||
if (!original_caster) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Do not allow detrimental spread to anything the original caster couldn't normally attack.
|
||||
if (is_detrimental_spell && !original_caster->IsAttackAllowed(mob, true)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user