summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-30 21:24:02 +0100
committerMattes D <github@xoft.cz>2015-02-04 08:40:52 +0100
commit014b96adb33fa902072d9f35661bc4f5e7c323e8 (patch)
tree46dcb57a65829d6364cbabec7add4021b9008ee6 /src/Bindings/LuaState.cpp
parentcNetwork: Exported lookup functions to Lua API. (diff)
downloadcuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.tar
cuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.tar.gz
cuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.tar.bz2
cuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.tar.lz
cuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.tar.xz
cuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.tar.zst
cuberite-014b96adb33fa902072d9f35661bc4f5e7c323e8.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 4de34c88d..73b114599 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -656,6 +656,18 @@ void cLuaState::Push(cItems * a_Items)
+void cLuaState::Push(cLuaServerHandle * a_ServerHandle)
+{
+ ASSERT(IsValid());
+
+ tolua_pushusertype(m_LuaState, a_ServerHandle, "cServerHandle");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
void cLuaState::Push(cLuaTCPLink * a_TCPLink)
{
ASSERT(IsValid());
@@ -970,6 +982,15 @@ void cLuaState::GetStackValue(int a_StackPos, pWorld & a_ReturnedVal)
+void cLuaState::GetStackValue(int a_StackPos, cRef & a_Ref)
+{
+ a_Ref.RefStack(*this, a_StackPos);
+}
+
+
+
+
+
bool cLuaState::CallFunction(int a_NumResults)
{
ASSERT (m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first
@@ -1539,6 +1560,18 @@ cLuaState::cRef::cRef(cLuaState & a_LuaState, int a_StackPos) :
+cLuaState::cRef::cRef(cRef && a_FromRef):
+ m_LuaState(a_FromRef.m_LuaState),
+ m_Ref(a_FromRef.m_Ref)
+{
+ a_FromRef.m_LuaState = nullptr;
+ a_FromRef.m_Ref = LUA_REFNIL;
+}
+
+
+
+
+
cLuaState::cRef::~cRef()
{
if (m_LuaState != nullptr)