From c7e33eb6b919f3492e30281d029835bf804b262c Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 14 Jul 2017 23:13:33 -0400 Subject: [PATCH] Fix totems issue and add despawn Despawn should tell client ... still TODO --- zone/aura.cpp | 7 +++++++ zone/spells.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/zone/aura.cpp b/zone/aura.cpp index 326ff8974..9ad2ec468 100644 --- a/zone/aura.cpp +++ b/zone/aura.cpp @@ -273,6 +273,8 @@ void Aura::ProcessTotem(Mob *owner) auto mob = e.second; if (mob == this) continue; + if (mob == owner) + continue; if (owner->IsAttackAllowed(mob)) { // might need more checks ... bool in_range = DistanceSquared(GetPosition(), mob->GetPosition()) <= distance; auto it = casted_on.find(mob->GetID()); @@ -341,6 +343,11 @@ bool Aura::Process() return true; } + if (remove_timer.Check()) { + Depop(); + return true; + } + if (movement_type == AuraMovement::Follow && GetPosition() != owner->GetPosition() && movement_timer.Check()) { m_Position = owner->GetPosition(); SendPosUpdate(); diff --git a/zone/spells.cpp b/zone/spells.cpp index d95d328fe..8e7d6721a 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3447,7 +3447,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r if(spelltar->IsClient() && spelltar->CastToClient()->IsHoveringForRespawn()) return false; - if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar) && !IsResurrectionEffects(spell_id)) { + if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) { if(!IsClient() || !CastToClient()->GetGM()) { Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); return false;