--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-18 11:05:35 -05:00
8 changed files with 47 additions and 21 deletions
+12 -2
View File
@@ -642,16 +642,24 @@ void Map::RelocationNotify()
unit->m_Notified = true;
unit->m_IsInNotifyList = false;
float dist = abs(unit->GetPositionX() - unit->oldX) + abs(unit->GetPositionY() - unit->oldY);
if(dist > 10.0f)
{
Trinity::VisibleChangesNotifier notifier(*unit);
VisitWorld(unit->oldX, unit->oldY, World::GetMaxVisibleDistance(), notifier);
dist = 0;
}
if(unit->GetTypeId() == TYPEID_PLAYER)
{
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier);
notifier.Notify();
}
else
{
Trinity::CreatureRelocationNotifier notifier(*((Creature*)unit));
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier);
}
}
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
@@ -667,6 +675,8 @@ void Map::AddUnitToNotify(Unit* u)
return;
u->m_IsInNotifyList = true;
u->oldX = u->GetPositionX();
u->oldY = u->GetPositionY();
if(i_lock)
i_unitsToNotifyBacklog.push_back(u->GetGUID());
+2
View File
@@ -18164,6 +18164,8 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target)
template<class T>
void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow)
{
if(!target)
return;
if(HaveAtClient(target))
{
if(!target->isVisibleForInState(this,true))
+6 -9
View File
@@ -186,10 +186,14 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
if(!player)
return;
Player *pFriend = ObjectAccessor::FindPlayer(friendGUID);
friendInfo.Status = FRIEND_STATUS_OFFLINE;
friendInfo.Area = 0;
friendInfo.Level = 0;
friendInfo.Class = 0;
Player *pFriend = ObjectAccessor::FindPlayer(friendGUID);
if(!pFriend)
return;
return;
uint32 team = player->GetTeam();
uint32 security = player->GetSession()->GetSecurity();
@@ -216,13 +220,6 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
friendInfo.Level = pFriend->getLevel();
friendInfo.Class = pFriend->getClass();
}
else
{
friendInfo.Status = FRIEND_STATUS_OFFLINE;
friendInfo.Area = 0;
friendInfo.Level = 0;
friendInfo.Class = 0;
}
}
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket *data)
+14 -8
View File
@@ -4023,18 +4023,24 @@ void Spell::EffectTaunt(uint32 /*i*/)
{
// this effect use before aura Taunt apply for prevent taunt already attacking target
// for spell as marked "non effective at already attacking target"
if(unitTarget && unitTarget->GetTypeId() != TYPEID_PLAYER)
if(!unitTarget || !unitTarget->CanHaveThreatList()
|| unitTarget->getVictim() == m_caster)
{
if(unitTarget->getVictim()==m_caster)
{
SendCastResult(SPELL_FAILED_DONT_REPORT);
return;
}
SendCastResult(SPELL_FAILED_DONT_REPORT);
return;
}
// Also use this effect to set the taunter's threat to the taunted creature's highest value
if(unitTarget->CanHaveThreatList() && unitTarget->getThreatManager().getCurrentVictim())
unitTarget->getThreatManager().addThreat(m_caster,unitTarget->getThreatManager().getCurrentVictim()->getThreat());
if(unitTarget->getThreatManager().getCurrentVictim())
{
float myThreat = unitTarget->getThreatManager().getThreat(m_caster);
float itsThreat = unitTarget->getThreatManager().getCurrentVictim()->getThreat();
if(itsThreat > myThreat)
unitTarget->getThreatManager().addThreat(m_caster, itsThreat - myThreat);
}
if(((Creature*)unitTarget)->IsAIEnabled)
((Creature*)unitTarget)->AI()->AttackStart(m_caster);
}
void Spell::EffectWeaponDmg(uint32 i)
+2 -2
View File
@@ -10249,7 +10249,7 @@ void Unit::TauntApply(Unit* taunter)
if (((Creature*)this)->IsAIEnabled)
((Creature*)this)->AI()->AttackStart(taunter);
m_ThreatManager.tauntApply(taunter);
//m_ThreatManager.tauntApply(taunter);
}
//======================================================================
@@ -10275,7 +10275,7 @@ void Unit::TauntFadeOut(Unit *taunter)
return;
}
m_ThreatManager.tauntFadeOut(taunter);
//m_ThreatManager.tauntFadeOut(taunter);
target = m_ThreatManager.getHostilTarget();
if (target && target != taunter)
+3
View File
@@ -1581,8 +1581,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void AddPetAura(PetAura const* petSpell);
void RemovePetAura(PetAura const* petSpell);
// relocation notification
void SetToNotify();
bool m_Notified, m_IsInNotifyList;
float oldX, oldY;
void SetReducedThreatPercent(uint32 pct, uint64 guid)
{
m_reducedThreatPercent = pct;