Eluna implement functions from #121, implement hidden file ignoring closes #122, enhance documentation in places, change requiring some now only allowing unique filenames

This commit is contained in:
Rochet2
2014-11-22 17:16:41 +02:00
parent 93982a16c1
commit a7f4954fbe
10 changed files with 617 additions and 125 deletions

View File

@@ -658,5 +658,34 @@ namespace LuaWorldObject
obj->elunaEvents->RemoveEvents();
return 0;
}
/**
* Returns true if the given [WorldObject] or coordinates are in the [WorldObject]'s line of sight
*
* @proto isInLoS = (worldobject)
* @proto isInLoS = (x, y, z)
*
* @param [WorldObject] worldobject
* @param float x
* @param float y
* @param float z
* @return bool isInLoS
*/
int IsWithinLoS(lua_State* L, WorldObject* obj)
{
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(L, 2, false);
if (target)
Eluna::Push(L, obj->IsWithinLOSInMap(target));
else
{
float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3);
float z = Eluna::CHECKVAL<float>(L, 4);
Eluna::Push(L, obj->IsWithinLOS(x, y, z));
}
return 1;
}
};
#endif