summaryrefslogtreecommitdiffstats
path: root/src/scripting
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-08-16 22:21:46 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-01-07 11:34:46 +0100
commit5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3 (patch)
treee4a1caa30ead4282b0513604688b4d7ece410984 /src/scripting
parent715bca7c9f84942d37e2ec707c84afb3760ad9c7 (diff)
downloadmanaserv-5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3.tar.gz
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
Diffstat (limited to 'src/scripting')
-rw-r--r--src/scripting/luascript.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp
index e2b127f..97b03e1 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