diff options
author | megamage <none@none> | 2009-05-01 11:26:19 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-01 11:26:19 -0500 |
commit | 182a04f5ea650ebacf98df3015fdedd4008eb6cb (patch) | |
tree | c5e5374beefd83e358b15f6160bc9f5b11e0f296 | |
parent | a098dc72fcb86880955a1e5ba775c5aaefe78e1e (diff) |
*Do not update object visibility immediately when object is added to map.
--HG--
branch : trunk
-rw-r--r-- | src/game/Map.cpp | 6 | ||||
-rw-r--r-- | src/game/Object.cpp | 6 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 20590eb071b..0989c4b4dab 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -519,10 +519,10 @@ Map::Add(T *obj) DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); //something, such as vehicle, needs to be update immediately - //if(obj->GetTypeId() != TYPEID_UNIT) - UpdateObjectVisibility(obj,cell,p); + if(obj->GetTypeId() != TYPEID_UNIT) + UpdateObjectVisibility(obj,cell,p); - //AddNotifier(obj); + AddNotifier(obj); } void Map::MessageBroadcast(Player *player, WorldPacket *msg, bool to_self, bool to_possessor) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index eb7ce37734d..af024de0896 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1649,6 +1649,8 @@ TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float a Add((Creature*)summon); summon->InitSummon(duration); + ObjectAccessor::UpdateObjectVisibility(summon); + return summon; } @@ -1706,6 +1708,8 @@ Vehicle* WorldObject::SummonVehicle(uint32 entry, float x, float y, float z, flo map->Add((Creature*)v); + ObjectAccessor::UpdateObjectVisibility(v); + return v; } @@ -1810,6 +1814,8 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy if(duration > 0) pet->SetDuration(duration); + ObjectAccessor::UpdateObjectVisibility(pet); + return pet; } diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index a8c06828b48..f0120596ce9 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -65,8 +65,8 @@ class TRINITY_DLL_SPEC Aura void SetAuraMaxDuration(int32 duration) { m_maxduration = duration; } int32 GetAuraDuration() const { return m_duration; } void SetAuraDuration(int32 duration); - void RefreshAura(){ SetAuraDuration (m_maxduration); } - inline bool IsExpired() { if(!GetAuraDuration() && !(IsPermanent() || (IsPassive()))) return true; return false;}; + void RefreshAura() { SetAuraDuration(m_maxduration); } + bool IsExpired() const { return !GetAuraDuration() && !(IsPermanent() || IsPassive()); } void SendAuraUpdate(); uint8 GetAuraSlot() const { return m_auraSlot; } |