From 393d066045fda5beee4748dc66754d70b4c82d36 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sat, 31 Jan 2009 21:49:58 +0100 Subject: Added on_remove callback to lua API --- src/scripting/luascript.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/scripting/luascript.cpp') diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index d208395..c88b95f 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -112,8 +112,17 @@ void LuaScript::processDeathEvent(Being *being) //TODO: get and push a list of creatures who contributed to killing the // being. This might be very interesting for scripting quests. execute(); +} + +void LuaScript::processRemoveEvent(Thing *being) +{ + prepare("remove_notification"); + push(being); + //TODO: get and push a list of creatures who contributed to killing the + // being. This might be very interesting for scripting quests. + execute(); - being->removeListener(getScriptDeathListener()); + being->removeListener(getScriptListener()); } /** -- cgit