Core/WorldObjects: Destroy for nearby players before removing from world

Closes issue 4806

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-11-16 21:17:49 +01:00
parent f5edd6ef2a
commit e87223b453
+11
View File
@@ -137,6 +137,7 @@ class Object
// synchronize values mirror with values array (changes will send in updatecreate opcode any way
ClearUpdateMask(true);
}
virtual void RemoveFromWorld()
{
if (!m_inWorld)
@@ -578,6 +579,16 @@ class WorldObject : public Object, public WorldLocation
void _Create(uint32 guidlow, HighGuid guidhigh, uint32 phaseMask);
virtual void RemoveFromWorld()
{
if (!IsInWorld())
return;
DestroyForNearbyPlayers();
Object::RemoveFromWorld();
}
void GetNearPoint2D(float &x, float &y, float distance, float absAngle) const;
void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d,float absAngle) const;
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d = 0, float angle = 0) const