aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Map.cpp5
-rw-r--r--src/game/Object.cpp1
-rw-r--r--src/game/Object.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index c6b0739b6bd..cb472947169 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -257,7 +257,7 @@ template<>
void Map::AddToGrid(Creature* obj, NGridType *grid, Cell const& cell)
{
// add to world object registry in grid
- if(obj->isPet() || obj->HasSharedVision())
+ if(obj->isPet() || obj->IsTempWorldObject)
{
(*grid)(cell.CellX(), cell.CellY()).AddWorldObject<Creature>(obj, obj->GetGUID());
}
@@ -309,7 +309,7 @@ template<>
void Map::RemoveFromGrid(Creature* obj, NGridType *grid, Cell const& cell)
{
// remove from world object registry in grid
- if(obj->isPet() || obj->HasSharedVision())
+ if(obj->isPet() || obj->IsTempWorldObject)
{
(*grid)(cell.CellX(), cell.CellY()).RemoveWorldObject<Creature>(obj, obj->GetGUID());
}
@@ -353,6 +353,7 @@ void Map::SwitchGridContainers(T* obj, bool on)
assert(false);
}
}
+ obj->IsTempWorldObject = on;
}
template void Map::SwitchGridContainers(Creature *, bool);
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 62ad688e52e..3952ed12ed4 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1068,6 +1068,7 @@ WorldObject::WorldObject()
mSemaphoreTeleport = false;
m_isActive = false;
+ IsTempWorldObject = false;
}
void WorldObject::SetWorldObject(bool on)
diff --git a/src/game/Object.h b/src/game/Object.h
index c6d5f73f3ed..1a7a70163ca 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -490,6 +490,8 @@ class TRINITY_DLL_SPEC WorldObject : public Object
template<class NOTIFIER> void VisitNearbyObject(const float &radius, NOTIFIER &notifier) const { GetMap()->VisitAll(GetPositionX(), GetPositionY(), radius, notifier); }
template<class NOTIFIER> void VisitNearbyGridObject(const float &radius, NOTIFIER &notifier) const { GetMap()->VisitGrid(GetPositionX(), GetPositionY(), radius, notifier); }
template<class NOTIFIER> void VisitNearbyWorldObject(const float &radius, NOTIFIER &notifier) const { GetMap()->VisitWorld(GetPositionX(), GetPositionY(), radius, notifier); }
+ bool IsTempWorldObject;
+
protected:
explicit WorldObject();
std::string m_name;