Small optimizations to some packet handlers.
This commit is contained in:
@@ -1364,7 +1364,10 @@ void Object::ExecuteDelayedActions()
|
||||
|
||||
bool WorldObject::IsWithinLootXPDist(WorldObject const* objToLoot) const
|
||||
{
|
||||
if (objToLoot && IsInMap(objToLoot) && objToLoot->GetMap()->IsRaid())
|
||||
if (!IsInMap(objToLoot))
|
||||
return false;
|
||||
|
||||
if (objToLoot->GetMap()->IsRaid())
|
||||
return true;
|
||||
|
||||
// Bosses have increased loot distance.
|
||||
@@ -1372,7 +1375,7 @@ bool WorldObject::IsWithinLootXPDist(WorldObject const* objToLoot) const
|
||||
if (objToLoot->IsCreature() && (static_cast<Creature const*>(objToLoot)->GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS))
|
||||
lootDistance += 150.0f;
|
||||
|
||||
return objToLoot && IsInMap(objToLoot) && _IsWithinDist(objToLoot, lootDistance, false);
|
||||
return _IsWithinDist(objToLoot, lootDistance, false);
|
||||
}
|
||||
|
||||
float WorldObject::GetVisibilityModifier() const
|
||||
@@ -1579,7 +1582,7 @@ bool WorldObject::IsWithinDist2d(float x, float y, float dist2compare, SizeFacto
|
||||
|
||||
bool WorldObject::IsInMap(WorldObject const* obj) const
|
||||
{
|
||||
return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap());
|
||||
return IsInWorld() && obj->IsInWorld() && (FindMap() == obj->FindMap());
|
||||
}
|
||||
|
||||
bool WorldObject::_IsWithinDist(WorldObject const* obj, float const dist2compare, const bool is3D, SizeFactor distcalc) const
|
||||
|
||||
Reference in New Issue
Block a user