mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[10020] Drop unused member in VisibleNotifier structure and related functions
(based on SilverIce's repo commit e678555) Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also applied mangos code style to GridNotifiersImpl.h
This commit is contained in:
parent
57ca730a2f
commit
d6c5207867
6 changed files with 127 additions and 145 deletions
|
|
@ -53,7 +53,7 @@ VisibleNotifier::Notify()
|
|||
{
|
||||
// ignore far sight case
|
||||
(*itr)->UpdateVisibilityOf((*itr),&i_player);
|
||||
i_player.UpdateVisibilityOf(&i_player,(*itr),i_data,i_data_updates,i_visibleNow);
|
||||
i_player.UpdateVisibilityOf(&i_player,(*itr),i_data,i_visibleNow);
|
||||
i_clientGUIDs.erase((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
|
|
@ -68,17 +68,6 @@ VisibleNotifier::Notify()
|
|||
DEBUG_FILTER_LOG(LOG_FILTER_VISIBILITY_CHANGES, "%s is out of range (no in active cells set) now for player %u",itr->GetString().c_str(),i_player.GetGUIDLow());
|
||||
}
|
||||
|
||||
// send update to other players (except player updates that already sent using SendUpdateToPlayer)
|
||||
for(UpdateDataMapType::iterator iter = i_data_updates.begin(); iter != i_data_updates.end(); ++iter)
|
||||
{
|
||||
if(iter->first==&i_player)
|
||||
continue;
|
||||
|
||||
WorldPacket packet;
|
||||
iter->second.BuildPacket(&packet);
|
||||
iter->first->GetSession()->SendPacket(&packet);
|
||||
}
|
||||
|
||||
if( i_data.HasData() )
|
||||
{
|
||||
// send create/outofrange packet to player (except player create updates that already sent using SendUpdateToPlayer)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ namespace MaNGOS
|
|||
{
|
||||
Player &i_player;
|
||||
UpdateData i_data;
|
||||
UpdateDataMapType i_data_updates;
|
||||
ObjectGuidSet i_clientGUIDs;
|
||||
std::set<WorldObject*> i_visibleNow;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,27 +29,24 @@
|
|||
#include "DBCEnums.h"
|
||||
|
||||
template<class T>
|
||||
inline void
|
||||
MaNGOS::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
inline void MaNGOS::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
WorldObject const* viewPoint = i_player.GetViewPoint();
|
||||
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_player.UpdateVisibilityOf(viewPoint,iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_player.UpdateVisibilityOf(viewPoint,iter->getSource(), i_data, i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
MaNGOS::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
inline void MaNGOS::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
}
|
||||
|
||||
inline void
|
||||
MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
inline void MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
|
|
@ -61,7 +58,7 @@ MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
|||
// Cancel Trade
|
||||
if (i_player.GetTrader()==iter->getSource())
|
||||
// iteraction distance
|
||||
if(!i_player.IsWithinDistInMap(iter->getSource(), 5))
|
||||
if (!i_player.IsWithinDistInMap(iter->getSource(), INTERACTION_DISTANCE))
|
||||
i_player.GetSession()->SendCancelTrade(); // will clode both side trade windows
|
||||
}
|
||||
}
|
||||
|
|
@ -94,8 +91,7 @@ inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2)
|
|||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
inline void MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
if (!i_player.isAlive() || i_player.isInFlight())
|
||||
return;
|
||||
|
|
@ -108,8 +104,7 @@ MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
|||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
inline void MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
if(!i_creature.isAlive())
|
||||
return;
|
||||
|
|
@ -121,8 +116,7 @@ MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
|||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m)
|
||||
inline void MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
if (!i_creature.isAlive())
|
||||
return;
|
||||
|
|
@ -174,9 +168,11 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
|
|||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
|
||||
SpellEffectIndex eff_index = i_dynobject.GetEffIndex();
|
||||
|
||||
// Check target immune to spell or aura
|
||||
if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index))
|
||||
return;
|
||||
|
||||
// Apply PersistentAreaAura on target
|
||||
PersistentAreaAura* Aur = new PersistentAreaAura(spellInfo, eff_index, NULL, target, i_dynobject.GetCaster());
|
||||
target->AddAura(Aur);
|
||||
|
|
@ -184,16 +180,14 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
|
|||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType &m)
|
||||
inline void MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
VisitHelper(itr->getSource());
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
MaNGOS::DynamicObjectUpdater::Visit(PlayerMapType &m)
|
||||
inline void MaNGOS::DynamicObjectUpdater::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
VisitHelper(itr->getSource());
|
||||
|
|
|
|||
|
|
@ -19202,7 +19202,7 @@ inline void UpdateVisibilityOf_helper(ObjectGuidSet& s64, GameObject* target)
|
|||
}
|
||||
|
||||
template<class T>
|
||||
void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateData& data, UpdateDataMapType& /*data_updates*/, std::set<WorldObject*>& visibleNow)
|
||||
void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateData& data, std::set<WorldObject*>& visibleNow)
|
||||
{
|
||||
if(HaveAtClient(target))
|
||||
{
|
||||
|
|
@ -19231,11 +19231,11 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateD
|
|||
}
|
||||
}
|
||||
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Player* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Creature* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Corpse* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, GameObject* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, DynamicObject* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Player* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Creature* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, Corpse* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, GameObject* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, DynamicObject* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
|
||||
void Player::InitPrimaryProfessions()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2201,7 +2201,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* target);
|
||||
|
||||
template<class T>
|
||||
void UpdateVisibilityOf(WorldObject const* viewPoint,T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
void UpdateVisibilityOf(WorldObject const* viewPoint,T* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
|
||||
// Stealth detection system
|
||||
void HandleStealthedUnitsDetection();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10019"
|
||||
#define REVISION_NR "10020"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue