mirror of
https://github.com/weyne85/DML.git
synced 2025-10-29 16:57:49 +00:00
Version 1.1.2
More persistence
This commit is contained in:
18
modules/sixthSense.lua
Normal file
18
modules/sixthSense.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
sixthSense = {}
|
||||
sixthSense.version = "1.0.0"
|
||||
-- sniff out dead events and log them
|
||||
function sixthSense:onEvent(event)
|
||||
if event.id == 8 then -- S_EVENT_DEAD
|
||||
if event.initiator then
|
||||
local theObject = event.initiator
|
||||
trigger.action.outText("DEAD event: " .. theObject:getName(), 30)
|
||||
|
||||
else
|
||||
trigger.action.outText("DEAD event, no initiator", 30)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- add event handler
|
||||
world.addEventHandler(sixthSense)
|
||||
trigger.action.outText("sixthSense v" .. sixthSense.version .. " loaded.", 30)
|
||||
Reference in New Issue
Block a user