From 3a132996f798dbf552ac858b06fa656b6790a501 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 14 Apr 2013 11:15:35 +0200 Subject: Use a full user data for Entity references Only moved a single script function to a member for now, will do others in a separate commit. --- src/scripting/luascript.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/scripting/luascript.cpp') diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index 83ac36b..f5fb6a4 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -75,24 +75,21 @@ void LuaScript::prepareResume(Thread *thread) void LuaScript::push(int v) { assert(nbArgs >= 0); - lua_pushinteger(mCurrentState, v); + ::push(mCurrentState, v); ++nbArgs; } void LuaScript::push(const std::string &v) { assert(nbArgs >= 0); - lua_pushlstring(mCurrentState, v.c_str(), v.length()); + ::push(mCurrentState, v); ++nbArgs; } void LuaScript::push(Entity *v) { assert(nbArgs >= 0); - if (v) - lua_pushlightuserdata(mCurrentState, v); - else - lua_pushnil(mCurrentState); + ::push(mCurrentState, v); ++nbArgs; } -- cgit