* `position`: `{x=num, y=num, z=num}` (relative)
* `rotation`: `{x=num, y=num, z=num}`
* `set_properties(object property table)`
+* `is_player()`: returns true for players, false otherwise
##### LuaEntitySAO-only (no-op for other objects)
* `setvelocity({x=num, y=num, z=num})`
* `get_luaentity()`
##### Player-only (no-op for other objects)
-* `is_player()`: true for players, false for others
* `get_player_name()`: returns `""` if is not a player
* `get_look_dir()`: get camera direction as a unit vector
* `get_look_pitch()`: pitch in radians
return 0;
}
+// is_player(self)
+int ObjectRef::l_is_player(lua_State *L)
+{
+ NO_MAP_LOCK_REQUIRED;
+ ObjectRef *ref = checkobject(L, 1);
+ Player *player = getplayer(ref);
+ lua_pushboolean(L, (player != NULL));
+ return 1;
+}
+
/* LuaEntitySAO-only */
// setvelocity(self, {x=num, y=num, z=num})
/* Player-only */
-// is_player(self)
-int ObjectRef::l_is_player(lua_State *L)
-{
- NO_MAP_LOCK_REQUIRED;
- ObjectRef *ref = checkobject(L, 1);
- Player *player = getplayer(ref);
- lua_pushboolean(L, (player != NULL));
- return 1;
-}
-
// is_player_connected(self)
int ObjectRef::l_is_player_connected(lua_State *L)
{
// set_properties(self, properties)
static int l_set_properties(lua_State *L);
+ // is_player(self)
+ static int l_is_player(lua_State *L);
+
/* LuaEntitySAO-only */
// setvelocity(self, {x=num, y=num, z=num})
/* Player-only */
- // is_player(self)
- static int l_is_player(lua_State *L);
-
// is_player_connected(self)
static int l_is_player_connected(lua_State *L);