diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 12:28:00 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 12:28:00 +0100 |
commit | f1d9ac014efc6403e73223f36d3dbb7f5ed50236 (patch) | |
tree | ae9acb74c6a662a8697235f5ca1446e5e7a1e6b3 /src/script/lua_api | |
parent | 06b72069d8d29c109b8847c9e4ff7948cd79f632 (diff) | |
download | dragonfireclient-f1d9ac014efc6403e73223f36d3dbb7f5ed50236.tar.xz |
Moved Killaura to Lua; Added ForceField; Added Friendlist; Added ClientObjectRef:is_local_player(); Documented LocalPlayer:get_object()
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_clientobject.cpp | 9 | ||||
-rw-r--r-- | src/script/lua_api/l_clientobject.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/script/lua_api/l_clientobject.cpp b/src/script/lua_api/l_clientobject.cpp index 90f0bcd15..d88b538a1 100644 --- a/src/script/lua_api/l_clientobject.cpp +++ b/src/script/lua_api/l_clientobject.cpp @@ -87,6 +87,14 @@ int ClientObjectRef::l_is_player(lua_State *L) return 1; } +int ClientObjectRef::l_is_local_player(lua_State *L) +{ + ClientObjectRef *ref = checkobject(L, 1); + GenericCAO *gcao = get_generic_cao(ref, L); + lua_pushboolean(L, gcao->isLocalPlayer()); + return 1; +} + int ClientObjectRef::l_get_name(lua_State *L) { ClientObjectRef *ref = checkobject(L, 1); @@ -210,6 +218,7 @@ luaL_Reg ClientObjectRef::methods[] = {luamethod(ClientObjectRef, get_pos), luamethod(ClientObjectRef, get_acceleration), luamethod(ClientObjectRef, get_rotation), luamethod(ClientObjectRef, is_player), + luamethod(ClientObjectRef, is_local_player), luamethod(ClientObjectRef, get_name), luamethod(ClientObjectRef, get_attach), luamethod(ClientObjectRef, get_nametag), diff --git a/src/script/lua_api/l_clientobject.h b/src/script/lua_api/l_clientobject.h index 88a6956bc..521591444 100644 --- a/src/script/lua_api/l_clientobject.h +++ b/src/script/lua_api/l_clientobject.h @@ -60,6 +60,9 @@ private: // is_player(self) static int l_is_player(lua_State *L); + + // is_local_player(self) + static int l_is_local_player(lua_State *L); // get_name(self) static int l_get_name(lua_State *L); |