mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna remove WorldObject::GetWorldObjct, use Map::GetWorldObject
This commit is contained in:
@@ -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.
|
{ "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 },
|
{ "GetNearObject", &LuaWorldObject::GetNearObject },
|
||||||
{ "GetNearObjects", &LuaWorldObject::GetNearObjects },
|
{ "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
|
{ "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.
|
{ "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.
|
{ "GetAngle", &LuaWorldObject::GetAngle }, // :GetAngle(WorldObject or x, y) - Returns angle between world object and target or x and y coords.
|
||||||
|
|||||||
@@ -421,49 +421,6 @@ namespace LuaWorldObject
|
|||||||
return 1;
|
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.
|
* Returns the distance from this [WorldObject] to another [WorldObject], or from this [WorldObject] to a point.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user