Fix totems issue and add despawn

Despawn should tell client ... still TODO
This commit is contained in:
Michael Cook (mackal) 2017-07-14 23:13:33 -04:00
parent 2a7a88ff47
commit c7e33eb6b9
2 changed files with 8 additions and 1 deletions

View File

@ -273,6 +273,8 @@ void Aura::ProcessTotem(Mob *owner)
auto mob = e.second; auto mob = e.second;
if (mob == this) if (mob == this)
continue; continue;
if (mob == owner)
continue;
if (owner->IsAttackAllowed(mob)) { // might need more checks ... if (owner->IsAttackAllowed(mob)) { // might need more checks ...
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());
@ -341,6 +343,11 @@ bool Aura::Process()
return true; return true;
} }
if (remove_timer.Check()) {
Depop();
return true;
}
if (movement_type == AuraMovement::Follow && GetPosition() != owner->GetPosition() && movement_timer.Check()) { if (movement_type == AuraMovement::Follow && GetPosition() != owner->GetPosition() && movement_timer.Check()) {
m_Position = owner->GetPosition(); m_Position = owner->GetPosition();
SendPosUpdate(); SendPosUpdate();

View File

@ -3447,7 +3447,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
if(spelltar->IsClient() && spelltar->CastToClient()->IsHoveringForRespawn()) if(spelltar->IsClient() && spelltar->CastToClient()->IsHoveringForRespawn())
return false; 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()) { if(!IsClient() || !CastToClient()->GetGM()) {
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD);
return false; return false;