diff --git a/data/lua/feeding.lua b/data/lua/feeding.lua index f8b2e540d2b2a..b3e8df8b38145 100644 --- a/data/lua/feeding.lua +++ b/data/lua/feeding.lua @@ -7,6 +7,11 @@ local on_event = wesnoth.require("on_event") -- The feeding event code on_event("die", function() local ec = wesnoth.current.event_context + + if not ec.x1 or not ec.y1 or not ec.x2 or not ec.y2 then + return + end + local u_killer = wesnoth.get_unit(ec.x2, ec.y2) local u_victim = wesnoth.get_unit(ec.x1, ec.y1)