refactor(Core): rename namespaces and macros to acore (#2454)
This commit is contained in:
@@ -79,7 +79,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
|
||||
SetObjectScale(1);
|
||||
SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
_gridCoord = acore::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
|
||||
return false;
|
||||
}
|
||||
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
_gridCoord = acore::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -759,13 +759,13 @@ void Creature::DoFleeToGetAssistance()
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
|
||||
@@ -1846,7 +1846,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
||||
// select nearest hostile unit within the given distance (regardless of threat list).
|
||||
Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) const
|
||||
{
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
@@ -1856,11 +1856,11 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
||||
if (dist == 0.0f)
|
||||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
Trinity::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
Trinity::UnitLastSearcher<Trinity::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
@@ -1872,7 +1872,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
||||
// select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list.
|
||||
Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
{
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
@@ -1884,11 +1884,11 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
{
|
||||
Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
@@ -1924,14 +1924,14 @@ void Creature::CallAssistance()
|
||||
std::list<Creature*> assistList;
|
||||
|
||||
{
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
@@ -1956,14 +1956,14 @@ void Creature::CallForHelp(float radius)
|
||||
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
|
||||
return;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
TypeContainerVisitor<acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
@@ -2585,7 +2585,7 @@ std::string const& Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
|
||||
|
||||
void Creature::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o))
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->CreatureRelocation(this, x, y, z, o);
|
||||
|
||||
@@ -258,8 +258,8 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
|
||||
float dy = y + sin(followAngle + pathAngle) * followDist;
|
||||
float dz = z;
|
||||
|
||||
Trinity::NormalizeMapCoord(dx);
|
||||
Trinity::NormalizeMapCoord(dy);
|
||||
acore::NormalizeMapCoord(dx);
|
||||
acore::NormalizeMapCoord(dy);
|
||||
|
||||
member->UpdateGroundPositionZ(dx, dy, dz);
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ GossipMenu::~GossipMenu()
|
||||
|
||||
void GossipMenu::AddMenuItem(int32 menuItemId, uint8 icon, std::string const& message, uint32 sender, uint32 action, std::string const& boxMessage, uint32 boxMoney, bool coded /*= false*/)
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
ASSERT(_menuItems.size() <= GOSSIP_MAX_MENU_ITEMS);
|
||||
|
||||
// Find a free new id - script case
|
||||
@@ -120,7 +119,6 @@ void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, ui
|
||||
|
||||
void GossipMenu::AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMenuId, uint32 gossipActionPoi)
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemData& itemData = _menuItemData[menuItemId];
|
||||
|
||||
itemData.GossipActionMenuId = gossipActionMenuId;
|
||||
@@ -129,7 +127,6 @@ void GossipMenu::AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMen
|
||||
|
||||
uint32 GossipMenu::GetMenuItemSender(uint32 menuItemId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(menuItemId);
|
||||
if (itr == _menuItems.end())
|
||||
return 0;
|
||||
@@ -139,7 +136,6 @@ uint32 GossipMenu::GetMenuItemSender(uint32 menuItemId) const
|
||||
|
||||
uint32 GossipMenu::GetMenuItemAction(uint32 menuItemId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(menuItemId);
|
||||
if (itr == _menuItems.end())
|
||||
return 0;
|
||||
@@ -149,7 +145,6 @@ uint32 GossipMenu::GetMenuItemAction(uint32 menuItemId) const
|
||||
|
||||
bool GossipMenu::IsMenuItemCoded(uint32 menuItemId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(menuItemId);
|
||||
if (itr == _menuItems.end())
|
||||
return false;
|
||||
@@ -159,7 +154,6 @@ bool GossipMenu::IsMenuItemCoded(uint32 menuItemId) const
|
||||
|
||||
void GossipMenu::ClearMenu()
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
_menuItems.clear();
|
||||
_menuItemData.clear();
|
||||
}
|
||||
@@ -281,8 +275,6 @@ void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon)
|
||||
if (!sObjectMgr->GetQuestTemplate(QuestId))
|
||||
return;
|
||||
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
|
||||
ASSERT(_questMenuItems.size() <= GOSSIP_MAX_MENU_ITEMS);
|
||||
|
||||
QuestMenuItem questMenuItem;
|
||||
@@ -295,7 +287,6 @@ void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon)
|
||||
|
||||
bool QuestMenu::HasItem(uint32 questId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
for (QuestMenuItemList::const_iterator i = _questMenuItems.begin(); i != _questMenuItems.end(); ++i)
|
||||
if (i->QuestId == questId)
|
||||
return true;
|
||||
@@ -305,7 +296,6 @@ bool QuestMenu::HasItem(uint32 questId) const
|
||||
|
||||
void QuestMenu::ClearMenu()
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
_questMenuItems.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -163,19 +163,16 @@ class GossipMenu
|
||||
|
||||
uint32 GetMenuItemCount() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _menuItems.size();
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _menuItems.empty();
|
||||
}
|
||||
|
||||
GossipMenuItem const* GetItem(uint32 id) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(id);
|
||||
if (itr != _menuItems.end())
|
||||
return &itr->second;
|
||||
@@ -185,7 +182,6 @@ class GossipMenu
|
||||
|
||||
GossipMenuItemData const* GetItemData(uint32 indexId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemDataContainer::const_iterator itr = _menuItemData.find(indexId);
|
||||
if (itr != _menuItemData.end())
|
||||
return &itr->second;
|
||||
@@ -204,9 +200,6 @@ class GossipMenu
|
||||
return _menuItems;
|
||||
}
|
||||
|
||||
//ACE_RW_Thread_Mutex& GetLock() const { return *(const_cast<ACE_RW_Thread_Mutex*>(&_menuLock)); }
|
||||
//ACE_RW_Thread_Mutex _menuLock; // pussywizard
|
||||
|
||||
private:
|
||||
GossipMenuItemContainer _menuItems;
|
||||
GossipMenuItemDataContainer _menuItemData;
|
||||
@@ -225,13 +218,11 @@ class QuestMenu
|
||||
|
||||
uint8 GetMenuItemCount() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _questMenuItems.size();
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _questMenuItems.empty();
|
||||
}
|
||||
|
||||
@@ -239,13 +230,9 @@ class QuestMenu
|
||||
|
||||
QuestMenuItem const& GetItem(uint16 index) const
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _questMenuItems[index];
|
||||
}
|
||||
|
||||
//ACE_RW_Thread_Mutex& GetLock() const { return *(const_cast<ACE_RW_Thread_Mutex*>(&_menuLock)); }
|
||||
//ACE_RW_Thread_Mutex _menuLock; // pussywizard
|
||||
|
||||
private:
|
||||
QuestMenuItemList _questMenuItems;
|
||||
};
|
||||
|
||||
@@ -453,7 +453,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases
|
||||
for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++)
|
||||
// m_unique_users can contain only player GUIDs
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, Trinity::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, acore::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true);
|
||||
|
||||
// finish owners spell
|
||||
@@ -601,8 +601,8 @@ void GameObject::Update(uint32 diff)
|
||||
// search unfriendly creature
|
||||
if (owner) // hunter trap
|
||||
{
|
||||
Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
acore::UnitSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyGridObject(radius, searcher);
|
||||
if (!target)
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
@@ -612,8 +612,8 @@ void GameObject::Update(uint32 diff)
|
||||
// environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support
|
||||
// affect only players
|
||||
Player* player = NULL;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
target = player;
|
||||
}
|
||||
@@ -1170,13 +1170,13 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
GameObject* trapGO = NULL;
|
||||
{
|
||||
// using original GO distance
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
TypeContainerVisitor<acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
cell.Visit(p, object_checker, *GetMap(), *target, range);
|
||||
}
|
||||
|
||||
@@ -1190,12 +1190,12 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
{
|
||||
GameObject* ok = NULL;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
Trinity::NearestGameObjectFishingHole u_check(*this, range);
|
||||
Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
acore::GameObjectSearcher<acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
TypeContainerVisitor<acore::GameObjectSearcher<acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
|
||||
|
||||
return ok;
|
||||
@@ -1951,7 +1951,7 @@ void GameObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*s
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION * 2.0f; // pussywizard: to ensure everyone receives all important packets
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -2455,7 +2455,7 @@ void GameObject::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
// pussywizard: do not call for MotionTransport and other gobjects not in grid
|
||||
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o))
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->GameObjectRelocation(this, x, y, z, o);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_BAG_H
|
||||
#define TRINITY_BAG_H
|
||||
#ifndef ACORE_BAG_H
|
||||
#define ACORE_BAG_H
|
||||
|
||||
// Maximum 36 Slots ((CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
|
||||
#define MAX_BAG_SIZE 36 // 2.0.12
|
||||
|
||||
@@ -1421,8 +1421,8 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran
|
||||
rand_y = pos.m_positionY + new_dist * sin(angle);
|
||||
rand_z = pos.m_positionZ;
|
||||
|
||||
Trinity::NormalizeMapCoord(rand_x);
|
||||
Trinity::NormalizeMapCoord(rand_y);
|
||||
acore::NormalizeMapCoord(rand_x);
|
||||
acore::NormalizeMapCoord(rand_y);
|
||||
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
@@ -1503,7 +1503,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
|
||||
|
||||
bool Position::IsPositionValid() const
|
||||
{
|
||||
return Trinity::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
return acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
}
|
||||
|
||||
float WorldObject::GetGridActivationRange() const
|
||||
@@ -1871,7 +1871,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
|
||||
}
|
||||
}
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
class MonsterChatBuilder
|
||||
{
|
||||
@@ -1919,61 +1919,61 @@ namespace Trinity
|
||||
Language i_language;
|
||||
WorldObject const* i_target;
|
||||
};
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
@@ -1987,15 +1987,15 @@ void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target,
|
||||
|
||||
void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)));
|
||||
}
|
||||
|
||||
@@ -2043,7 +2043,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -2370,8 +2370,8 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
|
||||
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
acore::CreatureLastSearcher<acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
VisitNearbyObject(range, searcher);
|
||||
return creature;
|
||||
}
|
||||
@@ -2379,8 +2379,8 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
|
||||
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
Trinity::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
@@ -2388,8 +2388,8 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
Trinity::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
@@ -2398,8 +2398,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
{
|
||||
Player* target = NULL;
|
||||
|
||||
Trinity::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
Trinity::PlayerLastSearcher<Trinity::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
acore::PlayerLastSearcher<acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyObject(distance, searcher);
|
||||
|
||||
return target;
|
||||
@@ -2407,32 +2407,32 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
/*
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
class NearUsedPosDo
|
||||
{
|
||||
@@ -2501,7 +2501,7 @@ namespace Trinity
|
||||
float i_angle;
|
||||
ObjectPosSelector& i_selector;
|
||||
};
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
*/
|
||||
|
||||
//===================================================================================================
|
||||
@@ -2511,8 +2511,8 @@ void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float abs
|
||||
x = GetPositionX() + (GetObjectSize() + distance2d) * cos(absAngle);
|
||||
y = GetPositionY() + (GetObjectSize() + distance2d) * sin(absAngle);
|
||||
|
||||
Trinity::NormalizeMapCoord(x);
|
||||
Trinity::NormalizeMapCoord(y);
|
||||
acore::NormalizeMapCoord(x);
|
||||
acore::NormalizeMapCoord(y);
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
|
||||
@@ -2619,7 +2619,7 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle)
|
||||
desty = pos.m_positionY + dist * sin(angle);
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Trinity::IsValidMapCoord(destx, desty))
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
sLog->outCrash("WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
@@ -2649,8 +2649,8 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle)
|
||||
|
||||
pos.Relocate(destx, desty, destz);
|
||||
|
||||
Trinity::NormalizeMapCoord(pos.m_positionX);
|
||||
Trinity::NormalizeMapCoord(pos.m_positionY);
|
||||
acore::NormalizeMapCoord(pos.m_positionX);
|
||||
acore::NormalizeMapCoord(pos.m_positionY);
|
||||
UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
pos.m_orientation = m_orientation;
|
||||
}
|
||||
@@ -2666,7 +2666,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
destz += 2.0f;
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Trinity::IsValidMapCoord(destx, desty))
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
@@ -2731,8 +2731,8 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
break;
|
||||
}
|
||||
|
||||
Trinity::NormalizeMapCoord(destx);
|
||||
Trinity::NormalizeMapCoord(desty);
|
||||
acore::NormalizeMapCoord(destx);
|
||||
acore::NormalizeMapCoord(desty);
|
||||
UpdateAllowedPositionZ(destx, desty, destz);
|
||||
|
||||
float ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true);
|
||||
@@ -2766,7 +2766,7 @@ void WorldObject::MovePositionToFirstCollisionForTotem(Position &pos, float dist
|
||||
destz = pos.GetPositionZ();
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Trinity::IsValidMapCoord(destx, desty))
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
@@ -2842,8 +2842,8 @@ void WorldObject::MovePositionToFirstCollisionForTotem(Position &pos, float dist
|
||||
destz = prevdz;
|
||||
}
|
||||
|
||||
Trinity::NormalizeMapCoord(destx);
|
||||
Trinity::NormalizeMapCoord(desty);
|
||||
acore::NormalizeMapCoord(destx);
|
||||
acore::NormalizeMapCoord(desty);
|
||||
|
||||
pos.Relocate(destx, desty, destz);
|
||||
pos.m_orientation = m_orientation;
|
||||
@@ -2884,8 +2884,8 @@ void WorldObject::DestroyForNearbyPlayers()
|
||||
return;
|
||||
|
||||
std::list<Player*> targets;
|
||||
Trinity::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange()+VISIBILITY_COMPENSATION, false);
|
||||
Trinity::PlayerListSearcherWithSharedVision<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange()+VISIBILITY_COMPENSATION, false);
|
||||
acore::PlayerListSearcherWithSharedVision<acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
VisitNearbyWorldObject(GetVisibilityRange()+VISIBILITY_COMPENSATION, searcher);
|
||||
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
@@ -2908,7 +2908,7 @@ void WorldObject::DestroyForNearbyPlayers()
|
||||
void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
|
||||
{
|
||||
//updates object's visibility for nearby players
|
||||
Trinity::VisibleChangesNotifier notifier(*this);
|
||||
acore::VisibleChangesNotifier notifier(*this);
|
||||
VisitNearbyWorldObject(GetVisibilityRange()+VISIBILITY_COMPENSATION, notifier);
|
||||
}
|
||||
|
||||
@@ -3013,7 +3013,7 @@ struct WorldObjectChangeAccumulator
|
||||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
WorldObjectChangeAccumulator notifier(*this, data_map, player_set);
|
||||
@@ -3027,17 +3027,17 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& play
|
||||
|
||||
void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*> &creatureList, float radius, uint32 entry)
|
||||
{
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius);
|
||||
}
|
||||
|
||||
|
||||
@@ -1059,7 +1059,7 @@ class WorldObject : public Object, public WorldLocation
|
||||
bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
|
||||
class ObjectDistanceOrderPred
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_OBJECTDEFINES_H
|
||||
#define TRINITY_OBJECTDEFINES_H
|
||||
#ifndef ACORE_OBJECTDEFINES_H
|
||||
#define ACORE_OBJECTDEFINES_H
|
||||
|
||||
#include "Define.h"
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ inline void KillRewarder::_InitGroupData()
|
||||
_maxLevel = lvl;
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint32 grayLevel = Trinity::XP::GetGrayLevel(lvl);
|
||||
uint32 grayLevel = acore::XP::GetGrayLevel(lvl);
|
||||
if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
|
||||
_maxNotGrayMember = member;
|
||||
}
|
||||
@@ -502,7 +502,7 @@ inline void KillRewarder::_InitXP(Player* player)
|
||||
// * otherwise, not in PvP;
|
||||
// * not if killer is on vehicle.
|
||||
if (_isBattleGround || (!_isPvP && !_killer->GetVehicle()))
|
||||
_xp = Trinity::XP::Gain(player, _victim, _isBattleGround);
|
||||
_xp = acore::XP::Gain(player, _victim, _isBattleGround);
|
||||
|
||||
if (_xp && !_isBattleGround && _victim) // pussywizard: npcs with relatively low hp give lower exp
|
||||
if (_victim->GetTypeId() == TYPEID_UNIT)
|
||||
@@ -615,7 +615,7 @@ void KillRewarder::_RewardGroup()
|
||||
{
|
||||
// 3.1.2. Alter group rate if group is in raid (not for battlegrounds).
|
||||
const bool isRaid = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsRaid() && _group->isRaidGroup();
|
||||
_groupRate = Trinity::XP::xp_in_group_rate(_count, isRaid);
|
||||
_groupRate = acore::XP::xp_in_group_rate(_count, isRaid);
|
||||
}
|
||||
|
||||
// 3.1.3. Reward each group member (even dead or corpse) within reward distance.
|
||||
@@ -5697,7 +5697,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
|
||||
{
|
||||
// pussywizard: mutex needed (tc changed opcode to THREAD UNSAFE)
|
||||
static ACE_Thread_Mutex channelsLock;
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, channelsLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, channelsLock);
|
||||
|
||||
if (GetSession()->PlayerLoading() && !IsBeingTeleportedFar())
|
||||
return; // The client handles it automatically after loading, but not after teleporting
|
||||
@@ -5742,7 +5742,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
|
||||
char const* currentNameExt;
|
||||
|
||||
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
|
||||
currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY);
|
||||
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(LANG_CHANNEL_CITY);
|
||||
else
|
||||
currentNameExt = current_zone_name.c_str();
|
||||
|
||||
@@ -6387,7 +6387,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType)
|
||||
void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence)
|
||||
{
|
||||
uint8 plevel = getLevel(); // if defense than victim == attacker
|
||||
uint8 greylevel = Trinity::XP::GetGrayLevel(plevel);
|
||||
uint8 greylevel = acore::XP::GetGrayLevel(plevel);
|
||||
uint8 moblevel = victim->getLevelForTarget(this);
|
||||
/*if (moblevel < greylevel)
|
||||
return;*/ // Patch 3.0.8 (2009-01-20): You can no longer skill up weapons on mobs that are immune to damage.
|
||||
@@ -6883,7 +6883,7 @@ void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self, b
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -6893,7 +6893,7 @@ void Player::SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool
|
||||
if (self)
|
||||
GetSession()->SendPacket(data);
|
||||
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -7067,7 +7067,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
|
||||
break;
|
||||
}
|
||||
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= acore::XP::GetGrayLevel(getLevel()))
|
||||
percent *= rate;
|
||||
|
||||
if (percent <= 0.0f)
|
||||
@@ -7299,7 +7299,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
return false;
|
||||
|
||||
uint8 k_level = getLevel();
|
||||
uint8 k_grey = Trinity::XP::GetGrayLevel(k_level);
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(k_level);
|
||||
uint8 v_level = victim->getLevel();
|
||||
|
||||
if (v_level <= k_grey)
|
||||
@@ -7326,7 +7326,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
else
|
||||
victim_guid = 0; // Don't show HK: <rank> message, only log.
|
||||
|
||||
honor_f = ceil(Trinity::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
honor_f = ceil(acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
|
||||
// count the number of playerkills in one day
|
||||
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
||||
@@ -14112,7 +14112,7 @@ void Player::TradeCancel(bool sendback)
|
||||
|
||||
void Player::UpdateSoulboundTradeItems()
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
if (m_itemSoulboundTradeable.empty())
|
||||
return;
|
||||
|
||||
@@ -14136,14 +14136,14 @@ void Player::UpdateSoulboundTradeItems()
|
||||
|
||||
void Player::AddTradeableItem(Item* item)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
m_itemSoulboundTradeable.push_back(item);
|
||||
}
|
||||
|
||||
//TODO: should never allow an item to be added to m_itemSoulboundTradeable twice
|
||||
void Player::RemoveTradeableItem(Item* item)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
m_itemSoulboundTradeable.remove(item);
|
||||
}
|
||||
|
||||
@@ -14991,7 +14991,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
}
|
||||
|
||||
if (sWorld->getIntConfig(CONFIG_INSTANT_TAXI) == 2 && npcflags & UNIT_NPC_FLAG_FLIGHTMASTER)
|
||||
menu->GetGossipMenu().AddMenuItem(-1, GOSSIP_ICON_INTERACT_1, GetSession()->GetTrinityString(LANG_TOGGLE_INSTANT_FLIGHT), 0, GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT, "", 0, false); // instant flight toggle option
|
||||
menu->GetGossipMenu().AddMenuItem(-1, GOSSIP_ICON_INTERACT_1, GetSession()->GetAcoreString(LANG_TOGGLE_INSTANT_FLIGHT), 0, GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT, "", 0, false); // instant flight toggle option
|
||||
}
|
||||
|
||||
void Player::SendPreparedGossip(WorldObject* source)
|
||||
@@ -18026,7 +18026,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
m_transport->CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
if (!acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
{
|
||||
m_transport = NULL;
|
||||
m_movementInfo.transport.Reset();
|
||||
@@ -18757,7 +18757,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
||||
// Send problematic items by mail
|
||||
while (!problematicItems.empty())
|
||||
{
|
||||
std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM);
|
||||
std::string subject = GetSession()->GetAcoreString(LANG_NOT_EQUIPPED_ITEM);
|
||||
|
||||
MailDraft draft(subject, "There were problems with equipping item(s).");
|
||||
for (uint8 i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i)
|
||||
@@ -19543,7 +19543,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
||||
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, target_map, this))
|
||||
{
|
||||
GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED));
|
||||
GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetAcoreString(LANG_INSTANCE_CLOSED));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19574,9 +19574,9 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
||||
else if (mapDiff->hasErrorMessage) // if (missingAchievement) covered by this case
|
||||
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
|
||||
else if (missingItem)
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr->GetItemTemplate(missingItem)->Name1.c_str());
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetAcoreString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr->GetItemTemplate(missingItem)->Name1.c_str());
|
||||
else if (LevelMin)
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED), LevelMin);
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetAcoreString(LANG_LEVEL_MINREQUIRED), LevelMin);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -20949,8 +20949,8 @@ void Player::TextEmote(const std::string& text)
|
||||
|
||||
WorldPacket data;
|
||||
std::list<Player*> players;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
this->VisitNearbyWorldObject(sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), searcher);
|
||||
|
||||
for (auto const& itr : players)
|
||||
@@ -23040,10 +23040,10 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
||||
|
||||
void Player::UpdateVisibilityForPlayer(bool mapChange)
|
||||
{
|
||||
Trinity::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
m_seer->VisitNearbyObject(GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, notifierNoLarge);
|
||||
notifierNoLarge.SendToSelf();
|
||||
Trinity::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
m_seer->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, notifierLarge);
|
||||
notifierLarge.SendToSelf();
|
||||
|
||||
@@ -23926,7 +23926,7 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
|
||||
offItem->DeleteFromInventoryDB(trans); // deletes item from character's inventory
|
||||
offItem->SaveToDB(trans); // recursive and not have transaction guard into self, item not in inventory and can be save standalone
|
||||
|
||||
std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM);
|
||||
std::string subject = GetSession()->GetAcoreString(LANG_NOT_EQUIPPED_ITEM);
|
||||
MailDraft(subject, "There were problems with equipping one or several items").AddItem(offItem).SendMailTo(trans, this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
@@ -24079,7 +24079,7 @@ uint32 Player::GetResurrectionSpellId()
|
||||
bool Player::isHonorOrXPTarget(Unit* victim) const
|
||||
{
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel());
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(getLevel());
|
||||
|
||||
// Victim level less gray level
|
||||
if (v_level <= k_grey)
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef __TRINITY_SOCIALMGR_H
|
||||
#define __TRINITY_SOCIALMGR_H
|
||||
#ifndef __ACORE_SOCIALMGR_H
|
||||
#define __ACORE_SOCIALMGR_H
|
||||
|
||||
#include <ace/Singleton.h>
|
||||
#include "DatabaseEnv.h"
|
||||
|
||||
@@ -250,7 +250,7 @@ void MotionTransport::UpdatePosition(float x, float y, float z, float o)
|
||||
|
||||
void MotionTransport::AddPassenger(WorldObject* passenger, bool withAll)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, Lock);
|
||||
if (_passengers.insert(passenger).second)
|
||||
{
|
||||
if (Player* plr = passenger->ToPlayer())
|
||||
@@ -275,7 +275,7 @@ void MotionTransport::AddPassenger(WorldObject* passenger, bool withAll)
|
||||
|
||||
void MotionTransport::RemovePassenger(WorldObject* passenger, bool withAll)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, Lock);
|
||||
if (_passengers.erase(passenger) || _staticPassengers.erase(passenger))
|
||||
{
|
||||
if (Player* plr = passenger->ToPlayer())
|
||||
@@ -599,7 +599,7 @@ void MotionTransport::UpdatePassengerPositions(PassengerSet& passengers)
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!Trinity::IsValidMapCoord(x, y, z))
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
@@ -865,7 +865,7 @@ void StaticTransport::RelocateToProgress(uint32 progress)
|
||||
float oriRotAngle = oriRotAngleCurr + percRot * (oriRotAngleNext - oriRotAngleCurr);
|
||||
|
||||
// check if position is valid
|
||||
if (!Trinity::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
if (!acore::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
return;
|
||||
|
||||
// update position to new one
|
||||
@@ -900,7 +900,7 @@ void StaticTransport::UpdatePassengerPositions()
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!Trinity::IsValidMapCoord(x, y, z))
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
|
||||
@@ -1835,7 +1835,7 @@ void Unit::CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask school
|
||||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
|
||||
vSchoolAbsorbCopy.sort(Trinity::AbsorbAuraOrderPred());
|
||||
vSchoolAbsorbCopy.sort(acore::AbsorbAuraOrderPred());
|
||||
|
||||
// absorb without mana cost
|
||||
for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
|
||||
@@ -15672,8 +15672,8 @@ void Unit::UpdateReactives(uint32 p_time)
|
||||
Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
@@ -15701,14 +15701,14 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
return NULL;
|
||||
|
||||
// select random
|
||||
return Trinity::Containers::SelectRandomContainerElement(targets);
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
@@ -15736,7 +15736,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
return NULL;
|
||||
|
||||
// select random
|
||||
return Trinity::Containers::SelectRandomContainerElement(targets);
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
|
||||
@@ -16282,7 +16282,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
||||
|
||||
if (!nearMembers.empty())
|
||||
{
|
||||
nearMembers.sort(Trinity::HealthPctOrderPred());
|
||||
nearMembers.sort(acore::HealthPctOrderPred());
|
||||
if (Unit* target = nearMembers.front())
|
||||
{
|
||||
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
|
||||
@@ -17706,7 +17706,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
|
||||
// pussywizard: generally this is not needed here, delayed notifier will handle this, call only for pets
|
||||
if ((IsGuardian() || IsPet()) && IS_PLAYER_GUID(GetOwnerGUID()))
|
||||
{
|
||||
Trinity::AIRelocationNotifier notifier(*this);
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
@@ -18517,7 +18517,7 @@ void Unit::SendTeleportPacket(Position& pos)
|
||||
|
||||
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
|
||||
{
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, orientation))
|
||||
if (!acore::IsValidMapCoord(x, y, z, orientation))
|
||||
return false;
|
||||
|
||||
float old_orientation = GetOrientation();
|
||||
@@ -19040,10 +19040,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
//active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
Trinity::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
@@ -19074,10 +19074,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
Trinity::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
|
||||
@@ -19098,7 +19098,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
|
||||
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
|
||||
|
||||
Trinity::CreatureRelocationNotifier relocate(*unit);
|
||||
acore::CreatureRelocationNotifier relocate(*unit);
|
||||
unit->VisitNearbyObject(unit->GetVisibilityRange()+VISIBILITY_COMPENSATION, relocate);
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
@@ -19111,7 +19111,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
|
||||
if (!this->IsInWorld() || this->IsDuringRemoveFromWorld())
|
||||
return;
|
||||
|
||||
Trinity::AIRelocationNotifier notifier(*this);
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
this->VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
|
||||
@@ -2564,7 +2564,7 @@ class Unit : public WorldObject
|
||||
bool m_petCatchUp;
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
// Binary predicate for sorting Units based on percent value of a power
|
||||
class PowerPctOrderPred
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef __TRINITY_VEHICLE_H
|
||||
#define __TRINITY_VEHICLE_H
|
||||
#ifndef __ACORE_VEHICLE_H
|
||||
#define __ACORE_VEHICLE_H
|
||||
|
||||
#include "ObjectDefines.h"
|
||||
#include "VehicleDefines.h"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef __TRINITY_VEHICLEDEFINES_H
|
||||
#define __TRINITY_VEHICLEDEFINES_H
|
||||
#ifndef __ACORE_VEHICLEDEFINES_H
|
||||
#define __ACORE_VEHICLEDEFINES_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Map.h"
|
||||
|
||||
Reference in New Issue
Block a user