*Merge with 243.
--HG-- branch : trunk
This commit is contained in:
@@ -53,7 +53,7 @@ PlayerVisibilityNotifier::Notify()
|
||||
if(i_clientGUIDs.find((*itr)->GetGUID())!=i_clientGUIDs.end())
|
||||
{
|
||||
(*itr)->UpdateVisibilityOf(&i_player);
|
||||
i_player.UpdateVisibilityOf((*itr),i_data,i_data_updates,i_visibleNow);
|
||||
i_player.UpdateVisibilityOf((*itr),i_data,i_visibleNow);
|
||||
i_clientGUIDs.erase((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -71,17 +71,6 @@ PlayerVisibilityNotifier::Notify()
|
||||
#endif
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
@@ -42,17 +42,12 @@ namespace Trinity
|
||||
{
|
||||
Player &i_player;
|
||||
UpdateData i_data;
|
||||
UpdateDataMapType i_data_updates;
|
||||
Player::ClientGUIDs i_clientGUIDs;
|
||||
std::set<WorldObject*> i_visibleNow;
|
||||
|
||||
PlayerVisibilityNotifier(Player &player) : i_player(player),i_clientGUIDs(player.m_clientGUIDs) {}
|
||||
|
||||
template<class T> inline void Visit(GridRefManager<T> &);
|
||||
/*#ifdef WIN32
|
||||
template<> inline void Visit(PlayerMapType &);
|
||||
template<> inline void Visit(CreatureMapType &);
|
||||
#endif*/
|
||||
|
||||
void Notify(void);
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ Trinity::PlayerVisibilityNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
if(iter->getSource()->m_Notified) //self is also skipped in this check
|
||||
continue;
|
||||
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow);
|
||||
iter->getSource()->UpdateVisibilityOf(&i_player);
|
||||
|
||||
//if (!i_player.GetSharedVisionList().empty())
|
||||
@@ -112,7 +112,7 @@ Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
if(iter->getSource()->m_Notified)
|
||||
continue;
|
||||
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow);
|
||||
|
||||
PlayerCreatureRelocationWorker(&i_player, iter->getSource());
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ void InstanceSave::SaveToDB()
|
||||
// save instance data too
|
||||
std::string data;
|
||||
|
||||
Map *map = MapManager::Instance().FindMap(m_instanceid, GetMapId());
|
||||
Map *map = MapManager::Instance().FindMap(GetMapId(),m_instanceid);
|
||||
if(map)
|
||||
{
|
||||
assert(map->IsDungeon());
|
||||
|
||||
@@ -215,7 +215,6 @@ void Object::SendUpdateToPlayer(Player* player)
|
||||
UpdateData upd;
|
||||
WorldPacket packet;
|
||||
|
||||
upd.Clear();
|
||||
BuildCreateUpdateBlockForPlayer(&upd, player);
|
||||
upd.BuildPacket(&packet);
|
||||
player->GetSession()->SendPacket(&packet);
|
||||
|
||||
+10
-8
@@ -17154,7 +17154,10 @@ void Player::Uncharm()
|
||||
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
|
||||
}
|
||||
|
||||
assert(!GetCharmGUID());
|
||||
if(GetCharmGUID())
|
||||
{
|
||||
sLog.outError("CRASH ALARM! Player %s is not able to uncharm unit (Entry: %u, Type: %u)", GetName(), charm->GetEntry(), charm->GetTypeId());
|
||||
}
|
||||
}
|
||||
|
||||
void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const
|
||||
@@ -18781,7 +18784,7 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Player::UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow)
|
||||
void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow)
|
||||
{
|
||||
if(HaveAtClient(target))
|
||||
{
|
||||
@@ -18801,7 +18804,6 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType&
|
||||
if(target->isVisibleForInState(this,false))
|
||||
{
|
||||
visibleNow.insert(target);
|
||||
target->BuildUpdate(data_updates);
|
||||
target->BuildCreateUpdateBlockForPlayer(&data, this);
|
||||
UpdateVisibilityOf_helper(m_clientGUIDs,target);
|
||||
|
||||
@@ -18848,11 +18850,11 @@ void Player::UpdateVisibilityOf<Creature>(Creature* target, UpdateData& data, Up
|
||||
}
|
||||
}*/
|
||||
|
||||
template void Player::UpdateVisibilityOf(Player* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(Corpse* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(GameObject* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(DynamicObject* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(Player* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(Corpse* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(GameObject* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(DynamicObject* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
|
||||
void Player::InitPrimaryProffesions()
|
||||
{
|
||||
|
||||
+1
-1
@@ -2112,7 +2112,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
void SendInitialVisiblePackets(Unit* target);
|
||||
|
||||
template<class T>
|
||||
void UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
void UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
|
||||
|
||||
// Stealth detection system
|
||||
uint32 m_DetectInvTimer;
|
||||
|
||||
@@ -56,15 +56,22 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
|
||||
if(i_destinationHolder.HasArrived())
|
||||
{
|
||||
//unit.StopMoving();
|
||||
if(!unit.hasUnitState(UNIT_STAT_CHARGING))
|
||||
MovementInform(unit);
|
||||
arrived = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void PointMovementGenerator<T>:: Finalize(T &unit)
|
||||
{
|
||||
if(unit.hasUnitState(UNIT_STAT_CHARGING))
|
||||
unit.clearUnitState(UNIT_STAT_CHARGING);
|
||||
else if(arrived)
|
||||
MovementInform(unit);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void PointMovementGenerator<T>::MovementInform(T &unit)
|
||||
{
|
||||
@@ -78,7 +85,8 @@ template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit
|
||||
template void PointMovementGenerator<Player>::Initialize(Player&);
|
||||
template bool PointMovementGenerator<Player>::Update(Player &, const uint32 &diff);
|
||||
template void PointMovementGenerator<Player>::MovementInform(Player&);
|
||||
template void PointMovementGenerator<Player>::Finalize(Player&);
|
||||
|
||||
template void PointMovementGenerator<Creature>::Initialize(Creature&);
|
||||
template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 &diff);
|
||||
|
||||
template void PointMovementGenerator<Creature>::Finalize(Creature&);
|
||||
|
||||
@@ -32,10 +32,10 @@ class TRINITY_DLL_SPEC PointMovementGenerator
|
||||
{
|
||||
public:
|
||||
PointMovementGenerator(uint32 _id, float _x, float _y, float _z) : id(_id),
|
||||
i_x(_x), i_y(_y), i_z(_z), i_nextMoveTime(0) {}
|
||||
i_x(_x), i_y(_y), i_z(_z), i_nextMoveTime(0), arrived(false) {}
|
||||
|
||||
void Initialize(T &);
|
||||
void Finalize(T &unit){unit.clearUnitState(UNIT_STAT_CHARGING);}
|
||||
void Finalize(T &unit);
|
||||
void Reset(T &unit){unit.StopMoving();}
|
||||
bool Update(T &, const uint32 &diff);
|
||||
|
||||
@@ -49,6 +49,7 @@ class TRINITY_DLL_SPEC PointMovementGenerator
|
||||
float i_x,i_y,i_z;
|
||||
uint32 id;
|
||||
DestinationHolder< Traveller<T> > i_destinationHolder;
|
||||
bool arrived;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
+4
-12
@@ -1327,8 +1327,8 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
|
||||
{
|
||||
SearchAreaTarget(tempUnitMap, max_range, PUSH_TARGET_CENTER, SPELL_TARGETS_ALLY);
|
||||
tempUnitMap.sort(ChainHealingOrder(m_caster));
|
||||
if(cur->GetHealth() == cur->GetMaxHealth() && tempUnitMap.size())
|
||||
cur = tempUnitMap.front();
|
||||
//if(cur->GetHealth() == cur->GetMaxHealth() && tempUnitMap.size())
|
||||
// cur = tempUnitMap.front();
|
||||
}
|
||||
else
|
||||
SearchAreaTarget(tempUnitMap, max_range, PUSH_TARGET_CENTER, TargetType);
|
||||
@@ -1970,14 +1970,10 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
||||
break;
|
||||
}
|
||||
|
||||
if(unMaxTargets && TagUnitMap.size() > 1)
|
||||
if(unMaxTargets && !EffectChainTarget && TagUnitMap.size() > 1)
|
||||
{
|
||||
if(m_targets.getUnitTarget())
|
||||
{
|
||||
if(m_spellInfo->Id == 5246) //Intimidating Shout
|
||||
TagUnitMap.remove(m_targets.getUnitTarget());
|
||||
if(m_spellInfo->Id != 5246) //Intimidating Shout
|
||||
--unMaxTargets;
|
||||
}
|
||||
|
||||
// remove random units from the map
|
||||
std::list<Unit*>::iterator itr;
|
||||
@@ -1987,10 +1983,6 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
||||
advance(itr, urand(0, TagUnitMap.size() - 1));
|
||||
TagUnitMap.erase(itr);
|
||||
}
|
||||
|
||||
// the player's target will always be added to the map
|
||||
if(m_targets.getUnitTarget() && m_spellInfo->Id != 5246)
|
||||
TagUnitMap.push_back(m_targets.getUnitTarget());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user