mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-14 05:59:29 +01:00
*Cleanup in ObjectAccessor - this should fix some crashes
--HG-- branch : trunk
This commit is contained in:
@@ -3942,46 +3942,19 @@ void Map::ScriptsProcess()
|
||||
Creature*
|
||||
Map::GetCreature(uint64 guid)
|
||||
{
|
||||
Creature * ret = NULL;
|
||||
if (IS_CRE_OR_VEH_GUID(guid))
|
||||
ret = ObjectAccessor::GetObjectInWorld(guid, (Creature*)NULL);
|
||||
|
||||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
if (ret->GetMapId() != GetId())
|
||||
return NULL;
|
||||
|
||||
if (ret->GetInstanceId() != GetInstanceId())
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)NULL);
|
||||
}
|
||||
|
||||
GameObject*
|
||||
Map::GetGameObject(uint64 guid)
|
||||
{
|
||||
GameObject * ret = ObjectAccessor::GetObjectInWorld(guid, (GameObject*)NULL);
|
||||
if (!ret)
|
||||
return NULL;
|
||||
if (ret->GetMapId() != GetId())
|
||||
return NULL;
|
||||
if (ret->GetInstanceId() != GetInstanceId())
|
||||
return NULL;
|
||||
return ret;
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)NULL);
|
||||
}
|
||||
|
||||
DynamicObject*
|
||||
Map::GetDynamicObject(uint64 guid)
|
||||
{
|
||||
DynamicObject * ret = ObjectAccessor::GetObjectInWorld(guid, (DynamicObject*)NULL);
|
||||
if (!ret)
|
||||
return NULL;
|
||||
if (ret->GetMapId() != GetId())
|
||||
return NULL;
|
||||
if (ret->GetInstanceId() != GetInstanceId())
|
||||
return NULL;
|
||||
return ret;
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)NULL);
|
||||
}
|
||||
|
||||
void Map::UpdateIteratorBack(Player *player)
|
||||
|
||||
Reference in New Issue
Block a user