diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index f318bde..7257c0e 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -185,7 +185,6 @@ ElunaRegister 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. diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index 99299bb..0de745f 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -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(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. *