diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index a2dc53b..763d750 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -193,6 +193,7 @@ ElunaRegister WorldObjectMethods[] = { "GetMap", &LuaWorldObject::GetMap }, #if (!defined(TBC) && !defined(CLASSIC)) { "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, + { "SetPhaseMask", &LuaUnit::SetPhaseMask }, #endif { "GetInstanceId", &LuaWorldObject::GetInstanceId }, { "GetAreaId", &LuaWorldObject::GetAreaId }, @@ -296,9 +297,6 @@ ElunaRegister UnitMethods[] = { "SetNativeDisplayId", &LuaUnit::SetNativeDisplayId }, { "SetFacing", &LuaUnit::SetFacing }, { "SetFacingToObject", &LuaUnit::SetFacingToObject }, -#if (!defined(TBC) && !defined(CLASSIC)) - { "SetPhaseMask", &LuaUnit::SetPhaseMask }, -#endif { "SetSpeed", &LuaUnit::SetSpeed }, // {"SetStunned", &LuaUnit::SetStunned}, // :SetStunned([enable]) - UNDOCUMENTED - Stuns or removes stun {"SetRooted", &LuaUnit::SetRooted}, diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index ad648a8..de3c826 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -45,6 +45,20 @@ namespace LuaWorldObject Eluna::Push(L, obj->GetPhaseMask()); return 1; } + + /** + * Sets the [WorldObject]'s phase mask. + * + * @param uint32 phaseMask + * @param bool update = true : update visibility to nearby objects + */ + int SetPhaseMask(Eluna* /*E*/, lua_State* L, WorldObject* obj) + { + uint32 phaseMask = Eluna::CHECKVAL(L, 2); + bool update = Eluna::CHECKVAL(L, 3, true); + obj->SetPhaseMask(phaseMask, update); + return 0; + } #endif /**