diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 20 | ||||
-rw-r--r-- | src/script/lua_api/l_object.h | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index d8cfaf82b..d913019b1 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -557,6 +557,16 @@ int ObjectRef::l_set_properties(lua_State *L) 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}) @@ -705,16 +715,6 @@ int ObjectRef::l_get_luaentity(lua_State *L) /* 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) { diff --git a/src/script/lua_api/l_object.h b/src/script/lua_api/l_object.h index d51ca379f..daf91ce56 100644 --- a/src/script/lua_api/l_object.h +++ b/src/script/lua_api/l_object.h @@ -120,6 +120,9 @@ private: // 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}) @@ -156,9 +159,6 @@ private: /* 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); |