diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-08-16 22:21:46 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-01-07 11:34:46 +0100 |
commit | 5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3 (patch) | |
tree | e4a1caa30ead4282b0513604688b4d7ece410984 | |
parent | 715bca7c9f84942d37e2ec707c84afb3760ad9c7 (diff) | |
download | manaserv-5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3.tar.gz manaserv-5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3.tar.bz2 manaserv-5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3.tar.xz manaserv-5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3.zip |
Set the current map when executing being callbacks
The on_death and on_remove callbacks where not being executed in the
context of any map. Now they execute in the context of the map of the
being.
Reviewed-by: Erik Schilling
-rw-r--r-- | src/scripting/luascript.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index e2b127f7..97b03e1d 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -241,6 +241,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,6 +254,7 @@ 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 |