From 5f8ac3c36c88c4f6bf98a9877340b11e2bdd95e3 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Thu, 16 Aug 2012 22:21:46 +0200 Subject: 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 --- src/scripting/luascript.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2