diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-14 11:15:35 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-14 11:15:35 +0200 |
commit | 3a132996f798dbf552ac858b06fa656b6790a501 (patch) | |
tree | 050396efcc609d5234414f15d52b6f4c123e6f80 /src/scripting/luascript.cpp | |
parent | ff7041ab8d0c176a7c9764656c21177944f52c31 (diff) | |
download | manaserv-3a132996f798dbf552ac858b06fa656b6790a501.tar.gz manaserv-3a132996f798dbf552ac858b06fa656b6790a501.tar.xz manaserv-3a132996f798dbf552ac858b06fa656b6790a501.zip |
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.
Diffstat (limited to 'src/scripting/luascript.cpp')
-rw-r--r-- | src/scripting/luascript.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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; } |