mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[8703] Remove templates and some used functions from ObjectAccessor.
This commit is contained in:
parent
69abc9ece4
commit
f762b57fea
4 changed files with 44 additions and 97 deletions
|
|
@ -775,7 +775,30 @@ bool Map::RemoveBones(uint64 guid, float x, float y)
|
|||
{
|
||||
if (IsRemovalGrid(x, y))
|
||||
{
|
||||
Corpse * corpse = ObjectAccessor::Instance().GetObjectInWorld(GetId(), x, y, guid, (Corpse*)NULL);
|
||||
Corpse* corpse = ObjectAccessor::GetObjectInWorld(guid, (Corpse*)NULL);
|
||||
if(!corpse || corpse->GetMapId() != GetId())
|
||||
return false;
|
||||
|
||||
CellPair p = MaNGOS::ComputeCellPair(x,y);
|
||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::RemoveBones: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
|
||||
return false;
|
||||
}
|
||||
|
||||
CellPair q = MaNGOS::ComputeCellPair(corpse->GetPositionX(),corpse->GetPositionY());
|
||||
if(q.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || q.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::RemoveBones: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", corpse->GetGUIDLow(), corpse->GetTypeId(), corpse->GetPositionX(), corpse->GetPositionY(), q.x_coord, q.y_coord);
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 dx = int32(p.x_coord) - int32(q.x_coord);
|
||||
int32 dy = int32(p.y_coord) - int32(q.y_coord);
|
||||
|
||||
if (dx <= -2 || dx >= 2 || dy <= -2 || dy >= 2)
|
||||
return false;
|
||||
|
||||
if(corpse && corpse->GetTypeId() == TYPEID_CORPSE && corpse->GetType() == CORPSE_BONES)
|
||||
corpse->DeleteBonesFromWorld();
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue