steed/stead/timer.lua
2011-07-27 10:21:20 +00:00

24 lines
468 B
Lua

game.action = stead.hook(game.action, function(f, s, cmd, ...)
if cmd == 'user_timer' then
local r,v
if here().timer then
r,v = stead.call(here(), 'timer');
elseif s.timer then
r,v = stead.call(s, 'timer');
end
if r == nil and v == nil and stead.api_version < "1.3.5" then
return nil, true
end
return r,v
end
return f(s, cmd, ...);
end)
stead.module_init(function()
timer.callback = function(s)
return 'user_timer'
end
end)
-- vim:ts=4