Eluna remove WorldObject::GetWorldObjct, use Map::GetWorldObject

This commit is contained in:
Rochet2
2014-09-20 18:04:34 +03:00
parent ecb076b654
commit 5b337c7f2b
2 changed files with 0 additions and 44 deletions

View File

@@ -185,7 +185,6 @@ ElunaRegister<WorldObject> WorldObjectMethods[] =
{ "GetNearestCreature", &LuaWorldObject::GetNearestCreature }, // :GetNearestCreature([range, entry]) - Returns nearest creature with given entry in sight or given range entry can be 0 or nil for any.
{ "GetNearObject", &LuaWorldObject::GetNearObject },
{ "GetNearObjects", &LuaWorldObject::GetNearObjects },
{ "GetWorldObject", &LuaWorldObject::GetWorldObject }, // :GetWorldObject(guid) - Returns a world object (creature, player, gameobject) from the guid. The world object returned must be on the same map as the world object in the arguments.
{ "GetDistance", &LuaWorldObject::GetDistance }, // :GetDistance(WorldObject or x, y, z) - Returns the distance between 2 objects or location
{ "GetRelativePoint", &LuaWorldObject::GetRelativePoint }, // :GetRelativePoint(dist, rad) - Returns the x, y and z of a point dist away from worldobject.
{ "GetAngle", &LuaWorldObject::GetAngle }, // :GetAngle(WorldObject or x, y) - Returns angle between world object and target or x and y coords.

View File

@@ -421,49 +421,6 @@ namespace LuaWorldObject
return 1;
}
/**
* Returns a [WorldObject] based on it's guid if it is spawned
*
* @param uint64 guid
*
* @return [WorldObject] worldObject
*/
int GetWorldObject(lua_State* L, WorldObject* obj)
{
uint64 guid = Eluna::CHECKVAL<uint64>(L, 2);
#ifndef TRINITY
switch (GUID_HIPART(guid))
{
case HIGHGUID_PLAYER: Eluna::Push(L, obj->GetMap()->GetPlayer(ObjectGuid(guid))); break;
case HIGHGUID_TRANSPORT:
case HIGHGUID_MO_TRANSPORT:
case HIGHGUID_GAMEOBJECT: Eluna::Push(L, obj->GetMap()->GetGameObject(ObjectGuid(guid))); break;
#if (!defined(TBC) && !defined(CLASSIC))
case HIGHGUID_VEHICLE:
#endif
case HIGHGUID_UNIT:
case HIGHGUID_PET: Eluna::Push(L, obj->GetMap()->GetAnyTypeCreature(ObjectGuid(guid))); break;
default:
break;
}
#else
switch (GUID_HIPART(guid))
{
case HIGHGUID_PLAYER: Eluna::Push(L, eObjectAccessor->GetPlayer(*obj, ObjectGuid(guid))); break;
case HIGHGUID_TRANSPORT:
case HIGHGUID_MO_TRANSPORT:
case HIGHGUID_GAMEOBJECT: Eluna::Push(L, eObjectAccessor->GetGameObject(*obj, ObjectGuid(guid))); break;
case HIGHGUID_VEHICLE:
case HIGHGUID_UNIT: Eluna::Push(L, eObjectAccessor->GetCreature(*obj, ObjectGuid(guid))); break;
case HIGHGUID_PET: Eluna::Push(L, eObjectAccessor->GetPet(*obj, ObjectGuid(guid))); break;
default:
break;
}
#endif
return 1;
}
/**
* Returns the distance from this [WorldObject] to another [WorldObject], or from this [WorldObject] to a point.
*