Skip to content

Commit

Permalink
= fix for on_actor_before_death callback to kill actor in the res/gam…
Browse files Browse the repository at this point in the history
…edata/scripts/bind_stalker.script
  • Loading branch information
revolucas authored and Xottab-DUTY committed Aug 19, 2017
1 parent ea1b5a6 commit 41431b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions res/gamedata/scripts/bind_stalker.script
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,12 @@ function actor_binder:item_to_slot(obj)
log(string.format("item_to_slot [%s]", obj:name()))
end
-- actor before death callback
-- IMPORTANT: if you wish to kill actor you need to call db.actor:kill(level:object_by_id(whoID), true) in actor_before_death callback, to ensure all objects are properly destroyed.
-- IMPORTANT: if you wish to kill actor you need to call db.actor:kill(level.object_by_id(whoID), true) in actor_before_death callback, to ensure all objects are properly destroyed.
function actor_binder:on_actor_before_death(whoID)
-- log("[AVO] on_actor_before_death callback")
-- db.actor:set_health_ex(1)
db.actor:kill(level:object_by_id(whoID), true)
local killer = level.object_by_id(whoID) or db.actor
killer:kill(db.actor, true)
end
----| end:aVo |---------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 41431b5

Please sign in to comment.