Fix issue with trap auras casting on caster (#2378)

Unsure if something changed or I just failed to test correctly
This commit is contained in:
Michael Cook (mackal) 2022-08-18 12:34:37 -04:00 committed by GitHub
parent 216b6ef426
commit 25c6b055a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -628,7 +628,7 @@ void Aura::ProcessEnterTrap(Mob *owner)
continue; continue;
} }
// might need more checks ... // might need more checks ...
if (owner->IsAttackAllowed(mob) && DistanceSquared(GetPosition(), mob->GetPosition()) <= distance) { if (mob != owner && owner->IsAttackAllowed(mob) && DistanceSquared(GetPosition(), mob->GetPosition()) <= distance) {
SpellFinished(spell_id, mob); SpellFinished(spell_id, mob);
owner->RemoveAura(GetID(), false); // if we're a buff (ex. NEC) we don't want to strip :P owner->RemoveAura(GetID(), false); // if we're a buff (ex. NEC) we don't want to strip :P
break; break;
@ -646,7 +646,7 @@ void Aura::ProcessExitTrap(Mob *owner)
continue; continue;
} }
// might need more checks ... // might need more checks ...
if (owner->IsAttackAllowed(mob)) { if (mob != owner && owner->IsAttackAllowed(mob)) {
bool in_range = DistanceSquared(GetPosition(), mob->GetPosition()) <= distance; bool in_range = DistanceSquared(GetPosition(), mob->GetPosition()) <= distance;
auto it = casted_on.find(mob->GetID()); auto it = casted_on.find(mob->GetID());
if (it != casted_on.end()) { if (it != casted_on.end()) {