diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-06-15 15:16:36 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-06-15 15:16:36 +0200 |
| commit | fa75fe78bd76e910ab7dfc614bc75f3ce43f9793 (patch) | |
| tree | c58fbf5ca08da0f9726b8045d42a774aaf1fc576 /src/server/game/Entities/Player | |
| parent | a8a5239aad6f0396948978bdeae0979e7a8dfa97 (diff) | |
Core/Objects
* Split BuildValuesUpdate into separate virtual methods for every object type that does something special with update fields
* Removed _SetCreateBits/_SetUpdateBits to halve the amount of checks if field needs to be sent
Diffstat (limited to 'src/server/game/Entities/Player')
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2b2032d063e..04f246d716d 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -24,15 +24,14 @@ #include "Battlefield.h" #include "BattlefieldMgr.h" #include "BattlefieldWG.h" -#include "BattlegroundAV.h" #include "Battleground.h" +#include "BattlegroundAV.h" #include "BattlegroundMgr.h" #include "CellImpl.h" #include "Channel.h" #include "ChannelMgr.h" #include "CharacterDatabaseCleaner.h" #include "Chat.h" -#include <cmath> #include "Common.h" #include "ConditionMgr.h" #include "CreatureAI.h" @@ -49,8 +48,8 @@ #include "GuildMgr.h" #include "InstanceSaveMgr.h" #include "InstanceScript.h" -#include "Language.h" #include "LFGMgr.h" +#include "Language.h" #include "Log.h" #include "MapInstanced.h" #include "MapManager.h" @@ -59,17 +58,18 @@ #include "Opcodes.h" #include "OutdoorPvP.h" #include "OutdoorPvPMgr.h" -#include "ReputationMgr.h" #include "Pet.h" #include "QuestDef.h" +#include "ReputationMgr.h" #include "SkillDiscovery.h" #include "SocialMgr.h" +#include "Spell.h" #include "SpellAuraEffects.h" #include "SpellAuras.h" -#include "Spell.h" #include "SpellMgr.h" #include "Transport.h" #include "UpdateData.h" +#include "UpdateFieldFlags.h" #include "UpdateMask.h" #include "Util.h" #include "Vehicle.h" @@ -22229,14 +22229,30 @@ void Player::UpdateTriggerVisibility() { if (IS_CREATURE_GUID(*itr)) { - Creature* obj = GetMap()->GetCreature(*itr); - if (!obj || !(obj->IsTrigger() || obj->HasAuraType(SPELL_AURA_TRANSFORM))) // can transform into triggers + Creature* creature = GetMap()->GetCreature(*itr); + // Update fields of triggers, transformed units or unselectable units (values dependent on GM state) + if (!creature || (!creature->IsTrigger() && !creature->HasAuraType(SPELL_AURA_TRANSFORM) && !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))) continue; - obj->BuildValuesUpdateBlockForPlayer(&udata, this); + creature->SetFieldNotifyFlag(UF_FLAG_PUBLIC); + creature->BuildValuesUpdateBlockForPlayer(&udata, this); + creature->RemoveFieldNotifyFlag(UF_FLAG_PUBLIC); + } + else if (IS_GAMEOBJECT_GUID((*itr))) + { + GameObject* go = GetMap()->GetGameObject(*itr); + if (!go) + continue; + + go->SetFieldNotifyFlag(UF_FLAG_PUBLIC); + go->BuildValuesUpdateBlockForPlayer(&udata, this); + go->RemoveFieldNotifyFlag(UF_FLAG_PUBLIC); } } + if (!udata.HasData()) + return; + udata.BuildPacket(&packet); GetSession()->SendPacket(&packet); } |
