summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-05-09 13:21:03 +0200
committerLukas Pioch <lukas@zgow.de>2017-05-09 14:10:53 +0200
commit3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c (patch)
tree78f4f70ccad9c0534119651db7af7e7ec478485f /src/Bindings/LuaState.cpp
parentUpdated Core and ProtectionAreas to latest. (diff)
downloadcuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.tar
cuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.tar.gz
cuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.tar.bz2
cuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.tar.lz
cuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.tar.xz
cuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.tar.zst
cuberite-3d5ee3e5c7d29fc2a4f8e0c49d53c9d488a76e5c.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp96
1 files changed, 4 insertions, 92 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index ec63d2767..ca0a258d9 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -864,28 +864,6 @@ void cLuaState::Push(const AStringVector & a_Vector)
-void cLuaState::Push(const cCraftingGrid * a_Grid)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<cCraftingGrid *>(a_Grid)), "cCraftingGrid");
-}
-
-
-
-
-
-void cLuaState::Push(const cCraftingRecipe * a_Recipe)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<cCraftingRecipe *>(a_Recipe)), "cCraftingRecipe");
-}
-
-
-
-
-
void cLuaState::Push(const char * a_Value)
{
ASSERT(IsValid());
@@ -897,17 +875,6 @@ void cLuaState::Push(const char * a_Value)
-void cLuaState::Push(const cItems & a_Items)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<cItems *>(&a_Items)), "cItems");
-}
-
-
-
-
-
void cLuaState::Push(const cNil & a_Nil)
{
ASSERT(IsValid());
@@ -919,17 +886,6 @@ void cLuaState::Push(const cNil & a_Nil)
-void cLuaState::Push(const cPlayer * a_Player)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<cPlayer *>(a_Player)), "cPlayer");
-}
-
-
-
-
-
void cLuaState::Push(const cLuaState::cRef & a_Ref)
{
ASSERT(IsValid());
@@ -941,44 +897,11 @@ void cLuaState::Push(const cLuaState::cRef & a_Ref)
-void cLuaState::Push(const HTTPRequest * a_Request)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<HTTPRequest *>(a_Request)), "HTTPRequest");
-}
-
-
-
-
-
-void cLuaState::Push(const HTTPTemplateRequest * a_Request)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<HTTPTemplateRequest *>(a_Request)), "HTTPTemplateRequest");
-}
-
-
-
-
-
void cLuaState::Push(const Vector3d & a_Vector)
{
ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<Vector3d *>(&a_Vector)), "Vector3<double>");
-}
-
-
-
-
-
-void cLuaState::Push(const Vector3d * a_Vector)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<Vector3d *>(a_Vector)), "Vector3<double>");
+ auto c = new Vector3d(a_Vector);
+ tolua_pushusertype_and_takeownership(m_LuaState, c, "Vector3<double>");
}
@@ -988,19 +911,8 @@ void cLuaState::Push(const Vector3d * a_Vector)
void cLuaState::Push(const Vector3i & a_Vector)
{
ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<Vector3i *>(&a_Vector)), "Vector3<int>");
-}
-
-
-
-
-
-void cLuaState::Push(const Vector3i * a_Vector)
-{
- ASSERT(IsValid());
-
- tolua_pushusertype(m_LuaState, reinterpret_cast<void *>(const_cast<Vector3i *>(a_Vector)), "Vector3<int>");
+ auto c = new Vector3i(a_Vector);
+ tolua_pushusertype_and_takeownership(m_LuaState, c, "Vector3<int>");
}