diff options
| -rwxr-xr-x | src/server/game/Entities/Object/Object.h | 9 | ||||
| -rwxr-xr-x | src/server/game/Globals/ObjectAccessor.cpp | 5 | ||||
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 9 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index c579659623b..eab4dbeba99 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -669,12 +669,17 @@ class WorldObject : public Object, public WorldLocation } float GetDistanceZ(const WorldObject* obj) const; + bool IsSelfOrInSameMap(const WorldObject* obj) const + { + if (this == obj) + return true; + return IsInMap(obj); + } bool IsInMap(const WorldObject* obj) const { if (obj) return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj); - else - return false; + return false; } bool IsWithinDist3d(float x, float y, float z, float dist) const { return IsInDist(x, y, z, dist + GetObjectSize()); } diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index e473fe535a1..7f5557bd3ef 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -250,12 +250,9 @@ void ObjectAccessor::AddCorpsesToGrid(GridCoord const& gridpair, GridType& grid, for (Player2CorpsesMapType::iterator iter = i_player2corpse.begin(); iter != i_player2corpse.end(); ++iter) { + // We need this check otherwise a corpose may be added to a grid twice if (iter->second->IsInGrid()) - { - //TODO: add this assert later - //ASSERT(iter->second->GetGridCoord() == gridpair); continue; - } if (iter->second->GetGridCoord() == gridpair) { diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index df6ac44f2cc..525084a70ed 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -557,7 +557,14 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply) else { // owner has to be in world, or effect has to be applied to self - ASSERT((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first)); + if (!GetOwner()->IsSelfOrInSameMap(itr->first)) + { + //TODO: There is a crash caused by shadowfiend load addon + sLog->outCrash("Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id, + GetOwner()->GetName(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1), + itr->first->GetName(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1)); + ASSERT(false); + } itr->first->_CreateAuraApplication(this, itr->second); ++itr; } |
