From 44e20a5ba9bb2aa4e0bdac60445e969e92dd6302 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 24 Apr 2016 20:05:42 +0200 Subject: [PATCH] Sdk/LuaBinding: Add EntityHandle and WorldHandle queriers As requested Former-commit-id: 20e3d0621243caccd0d3283f077a33c03ab4d2a3 --- SDK/include/NDK/LuaAPI.inl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SDK/include/NDK/LuaAPI.inl b/SDK/include/NDK/LuaAPI.inl index 69b69f7ed..5a6f9d147 100644 --- a/SDK/include/NDK/LuaAPI.inl +++ b/SDK/include/NDK/LuaAPI.inl @@ -214,6 +214,20 @@ namespace Nz return ret; } + inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Ndk::EntityHandle* handle, TypeTag) + { + *handle = std::move(*static_cast(instance.CheckUserdata(index, "Entity"))); + + return 1; + } + + inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Ndk::WorldHandle* handle, TypeTag) + { + *handle = std::move(*static_cast(instance.CheckUserdata(index, "World"))); + + return 1; + } + #ifndef NDK_SERVER inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, InstancedRenderableRef* renderable, TypeTag) {