diff options
author | est31 <MTest31@outlook.com> | 2015-05-12 05:49:14 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-05-12 05:52:49 +0200 |
commit | b4c3ff6eab197828d370c30d66e033cde9d2f13d (patch) | |
tree | ee4d2e18caa3f40a8d77b9aa2968cfba95fc7771 /src/script/lua_api/l_object.cpp | |
parent | 02805af36ed4f3f11738c5439b5edd9e1db659ea (diff) | |
download | minetest-b4c3ff6eab197828d370c30d66e033cde9d2f13d.tar.gz minetest-b4c3ff6eab197828d370c30d66e033cde9d2f13d.tar.bz2 minetest-b4c3ff6eab197828d370c30d66e033cde9d2f13d.zip |
is_player() is no player-only function
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 20 |
1 files changed, 10 insertions, 10 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) { |