Core/Objects: ported master branch handling for properly destroying objects via out of range and destroy object opcode

# Conflicts:
#	src/server/game/Entities/Creature/Creature.cpp
This commit is contained in:
Shauren authored and Ovahlord committed 2022-02-02 16:24:42 +01:00
1 parent 284b2a23eb
commit f2b4f2208e
10 files changed
+43 -16

No files matched your search

+12 -1
View File
@@ -276,6 +276,17 @@ void Object::DestroyForPlayer(Player* target, bool isDead /*= false*/) const
target->SendDirectMessage(packet.Write());
}
void Object::SendOutOfRangeForPlayer(Player* target) const
{
ASSERT(target);
UpdateData updateData(target->GetMapId());
BuildOutOfRangeUpdateBlock(&updateData);
WorldPacket packet;
updateData.BuildPacket(&packet);
target->SendDirectMessage(&packet);
}
int32 Object::GetInt32Value(uint16 index) const
{
ASSERT(index < m_valuesCount || PrintIndexError(index, false));
@@ -1265,7 +1276,7 @@ void WorldObject::RemoveFromWorld()
if (!IsInWorld())
return;
DestroyForNearbyPlayers();
UpdateObjectVisibilityOnDestroy();
Object::RemoveFromWorld();
}