From fd7e86c79b78e68b2926546a185a58713d6330db Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 26 Oct 2010 16:41:40 +0400 Subject: [PATCH] [10647] Show die animation at totem destroy. Or any creature type die with linked unsummon. Original patch provided by Eggxp. --- src/game/Map.cpp | 2 +- src/game/Object.cpp | 4 ++-- src/game/Player.cpp | 14 ++++++++++---- src/shared/revision_nr.h | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 91c19e6c0..c42aa3800 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -723,7 +723,7 @@ Map::Remove(T *obj, bool remove) else obj->RemoveFromWorld(); - UpdateObjectVisibility(obj,cell,p); // i think will be better to call this function while object still in grid, this changes nothing but logically is better(as for me) + UpdateObjectVisibility(obj,cell,p); // i think will be better to call this function while object still in grid, this changes nothing but logically is better(as for me) RemoveFromGrid(obj,grid,cell); obj->ResetMap(); diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 61677ccae..19d572355 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -220,7 +220,7 @@ void Object::DestroyForPlayer( Player *target, bool anim ) const { MANGOS_ASSERT(target); - WorldPacket data(SMSG_DESTROY_OBJECT, 8); + WorldPacket data(SMSG_DESTROY_OBJECT, 9); data << GetObjectGuid(); data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation target->GetSession()->SendPacket(&data); @@ -2084,4 +2084,4 @@ bool WorldObject::IsControlledByPlayer() const default: return false; } -} +} \ No newline at end of file diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3ec381cbc..517e8cec4 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19359,12 +19359,18 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* targe { if(!target->isVisibleForInState(this, viewPoint, true)) { - if (target->GetTypeId()==TYPEID_UNIT) - BeforeVisibilityDestroy((Creature*)target,this); - ObjectGuid t_guid = target->GetGUID(); - target->DestroyForPlayer(this); + if (target->GetTypeId()==TYPEID_UNIT) + { + BeforeVisibilityDestroy((Creature*)target,this); + + // at remove from map (destroy) show kill animation (in different out of range/stealth case) + target->DestroyForPlayer(this, !target->IsInWorld() && ((Creature*)target)->isDead()); + } + else + target->DestroyForPlayer(this); + m_clientGUIDs.erase(t_guid); DEBUG_FILTER_LOG(LOG_FILTER_VISIBILITY_CHANGES, "%s out of range for player %u. Distance = %f",t_guid.GetString().c_str(),GetGUIDLow(),GetDistance(target)); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1421895ae..5135eb72a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10646" + #define REVISION_NR "10647" #endif // __REVISION_NR_H__