diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-20 15:34:28 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-20 15:34:28 +0100 |
commit | c70c6d19c1cabf46b595591802bceab63d371788 (patch) | |
tree | 1c153d2bfe560171bad5889d528dc5cf110e8533 /src/scripting/luascript.cpp | |
parent | d707495540581f8c1b9ab3d5007c9c4d1ab83b53 (diff) | |
parent | 587b7682e6bf7dd9e616c1d4789a5ed9aa986e6d (diff) | |
download | manaserv-c70c6d19c1cabf46b595591802bceab63d371788.tar.gz manaserv-c70c6d19c1cabf46b595591802bceab63d371788.tar.bz2 manaserv-c70c6d19c1cabf46b595591802bceab63d371788.tar.xz manaserv-c70c6d19c1cabf46b595591802bceab63d371788.zip |
Merge branch 'master' into lpc2012
Conflicts:
gameserver.cbp
src/account-server/accounthandler.cpp
src/game-server/attack.cpp
src/game-server/attack.h
src/game-server/being.cpp
src/game-server/being.h
src/game-server/character.cpp
src/game-server/character.h
src/game-server/inventory.cpp
src/game-server/item.h
src/game-server/monster.cpp
src/game-server/monster.h
Diffstat (limited to 'src/scripting/luascript.cpp')
-rw-r--r-- | src/scripting/luascript.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index e2b127f7..f4ea39ac 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -82,7 +82,7 @@ void LuaScript::push(int v) void LuaScript::push(const std::string &v) { assert(nbArgs >= 0); - lua_pushstring(mCurrentState, v.c_str()); + lua_pushlstring(mCurrentState, v.c_str(), v.length()); ++nbArgs; } @@ -151,7 +151,11 @@ bool LuaScript::resume() setMap(mCurrentThread->mMap); const int tmpNbArgs = nbArgs; nbArgs = -1; +#if LUA_VERSION_NUM < 502 int result = lua_resume(mCurrentState, tmpNbArgs); +#else + int result = lua_resume(mCurrentState, NULL, tmpNbArgs); +#endif setMap(0); if (result == 0) // Thread is done @@ -241,6 +245,7 @@ void LuaScript::processDeathEvent(Being *entity) { if (mDeathNotificationCallback.isValid()) { + setMap(entity->getMap()); prepare(mDeathNotificationCallback); push(entity); //TODO: get and push a list of creatures who contributed to killing the @@ -253,14 +258,13 @@ void LuaScript::processRemoveEvent(Entity *entity) { if (mRemoveNotificationCallback.isValid()) { + setMap(entity->getMap()); prepare(mRemoveNotificationCallback); push(entity); //TODO: get and push a list of creatures who contributed to killing the // being. This might be very interesting for scripting quests. execute(); } - - entity->removeListener(getScriptListener()); } /** |