diff options
author | Vincent Glize <vincent.glize@live.fr> | 2017-04-08 12:26:45 +0200 |
---|---|---|
committer | Auke Kok <sofar@foo-projects.org> | 2017-04-08 22:04:30 -0700 |
commit | 8ad3dad137df740ce63101bf224e977e66b9df2c (patch) | |
tree | 0e599de9bba2396e9500d30da849ae3f99f42ef1 /src/script/clientscripting.cpp | |
parent | 58d83a7bb2f992194c3df304b1dcbb81f98f78c0 (diff) | |
download | minetest-8ad3dad137df740ce63101bf224e977e66b9df2c.tar.gz minetest-8ad3dad137df740ce63101bf224e977e66b9df2c.tar.bz2 minetest-8ad3dad137df740ce63101bf224e977e66b9df2c.zip |
LocalPlayer api lua
Diffstat (limited to 'src/script/clientscripting.cpp')
-rw-r--r-- | src/script/clientscripting.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/clientscripting.cpp b/src/script/clientscripting.cpp index 6f91b82ec..ba3f910c0 100644 --- a/src/script/clientscripting.cpp +++ b/src/script/clientscripting.cpp @@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_util.h" #include "lua_api/l_item.h" #include "lua_api/l_nodemeta.h" +#include "lua_api/l_localplayer.h" ClientScripting::ClientScripting(Client *client): ScriptApiBase() @@ -69,4 +70,11 @@ void ClientScripting::InitializeModApi(lua_State *L, int top) StorageRef::Register(L); LuaMinimap::Register(L); NodeMetaRef::RegisterClient(L); + LuaLocalPlayer::Register(L); +} + +void ClientScripting::on_client_ready(LocalPlayer *localplayer) +{ + lua_State *L = getStack(); + LuaLocalPlayer::create(L, localplayer); } |