summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
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>");
}