Skip to content

Commit 41431b5

Browse files
revolucasXottab-DUTY
authored andcommitted
= fix for on_actor_before_death callback to kill actor in the res/gamedata/scripts/bind_stalker.script
1 parent ea1b5a6 commit 41431b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

res/gamedata/scripts/bind_stalker.script

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ function actor_binder:item_to_slot(obj)
200200
log(string.format("item_to_slot [%s]", obj:name()))
201201
end
202202
-- actor before death callback
203-
-- 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.
203+
-- 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.
204204
function actor_binder:on_actor_before_death(whoID)
205205
-- log("[AVO] on_actor_before_death callback")
206206
-- db.actor:set_health_ex(1)
207-
db.actor:kill(level:object_by_id(whoID), true)
207+
local killer = level.object_by_id(whoID) or db.actor
208+
killer:kill(db.actor, true)
208209
end
209210
----| end:aVo |---------------------------------------------------------------
210211
----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)