Rename some classes in grid system.
Note: The naming of classes is still confusing. "cell" usually refers to class "Grid", and "grid" usually refers to class "NGrid". But it requires a lot of changes to clean this up.
This commit is contained in:
@@ -95,7 +95,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
|
||||
SetFloatValue(OBJECT_FIELD_SCALE_X, 1);
|
||||
SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
m_grid = Trinity::ComputeGridPair(GetPositionX(), GetPositionY());
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field* fields)
|
||||
return false;
|
||||
}
|
||||
|
||||
m_grid = Trinity::ComputeGridPair(GetPositionX(), GetPositionY());
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,8 @@ class Corpse : public WorldObject, public GridObject<Corpse>
|
||||
void ResetGhostTime() { m_time = time(NULL); }
|
||||
CorpseType GetType() const { return m_type; }
|
||||
|
||||
GridPair const& GetGrid() const { return m_grid; }
|
||||
void SetGrid(GridPair const& grid) { m_grid = grid; }
|
||||
GridCoord const& GetGridCoord() const { return _gridCoord; }
|
||||
void SetGridCoord(GridCoord const& gridCoord) { _gridCoord = gridCoord; }
|
||||
|
||||
Loot loot; // remove insignia ONLY at BG
|
||||
Player* lootRecipient;
|
||||
@@ -88,7 +88,7 @@ class Corpse : public WorldObject, public GridObject<Corpse>
|
||||
private:
|
||||
CorpseType m_type;
|
||||
time_t m_time;
|
||||
GridPair m_grid; // gride for corpse position for fast search
|
||||
GridCoord _gridCoord; // gride for corpse position for fast search
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ void Creature::RemoveCorpse(bool setSpawnTime)
|
||||
m_respawnTime = time(NULL) + respawnDelay;
|
||||
|
||||
float x, y, z, o;
|
||||
GetRespawnCoord(x, y, z, &o);
|
||||
GetRespawnPosition(x, y, z, &o);
|
||||
SetHomePosition(x, y, z, o);
|
||||
GetMap()->CreatureRelocation(this, x, y, z, o);
|
||||
}
|
||||
@@ -659,7 +659,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -1760,7 +1760,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim)
|
||||
// select nearest hostile unit within the given distance (regardless of threat list).
|
||||
Unit* Creature::SelectNearestTarget(float dist) const
|
||||
{
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -1787,7 +1787,7 @@ Unit* Creature::SelectNearestTarget(float dist) const
|
||||
// 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
|
||||
{
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -1850,7 +1850,7 @@ void Creature::CallAssistance()
|
||||
std::list<Creature*> assistList;
|
||||
|
||||
{
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -1883,7 +1883,7 @@ void Creature::CallForHelp(float fRadius)
|
||||
if (fRadius <= 0.0f || !getVictim() || isPet() || isCharmed())
|
||||
return;
|
||||
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -2205,7 +2205,7 @@ time_t Creature::GetRespawnTimeEx() const
|
||||
return now;
|
||||
}
|
||||
|
||||
void Creature::GetRespawnCoord(float &x, float &y, float &z, float* ori, float* dist) const
|
||||
void Creature::GetRespawnPosition(float &x, float &y, float &z, float* ori, float* dist) const
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
{
|
||||
|
||||
@@ -456,7 +456,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
||||
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
|
||||
|
||||
void Update(uint32 time); // overwrited Unit::Update
|
||||
void GetRespawnCoord(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const;
|
||||
void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const;
|
||||
uint32 GetEquipmentId() const { return GetCreatureInfo()->equipmentId; }
|
||||
|
||||
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
|
||||
|
||||
@@ -931,7 +931,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
GameObject* trapGO = NULL;
|
||||
{
|
||||
// using original GO distance
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
|
||||
@@ -951,7 +951,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
{
|
||||
GameObject* ok = NULL;
|
||||
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
Trinity::NearestGameObjectFishingHole u_check(*this, range);
|
||||
|
||||
@@ -1868,7 +1868,7 @@ namespace Trinity
|
||||
|
||||
void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGuid)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
@@ -1883,7 +1883,7 @@ void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGui
|
||||
|
||||
void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
@@ -1898,7 +1898,7 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
|
||||
void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
@@ -1913,7 +1913,7 @@ void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGu
|
||||
|
||||
void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
@@ -1948,7 +1948,7 @@ void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsB
|
||||
|
||||
void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
@@ -2395,7 +2395,7 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const
|
||||
{
|
||||
CellPair pair(Trinity::ComputeCellPair(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -2409,7 +2409,7 @@ void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const
|
||||
{
|
||||
CellPair pair(Trinity::ComputeCellPair(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -2529,7 +2529,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
|
||||
|
||||
// adding used positions around object
|
||||
{
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
@@ -2826,7 +2826,7 @@ struct WorldObjectChangeAccumulator
|
||||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
Reference in New Issue
Block a user