steed/stead/timer.lua

24 lines
424 B
Lua
Raw Normal View History

2010-07-05 19:19:29 +03:00
game.action = stead.hook(game.action, function(f, s, cmd, ...)
if cmd == 'user_timer' then
2010-07-22 13:39:48 +03:00
local r,v
2010-07-27 10:36:08 +03:00
if here().timer then
r,v = call(here(), 'timer');
elseif s.timer then
r,v = call(s, 'timer');
end
2010-07-22 13:39:48 +03:00
if r == nil and v == nil then
return nil, true
end
return r,v
2010-07-05 19:19:29 +03:00
end
2011-02-23 12:11:27 +02:00
return f(s, cmd, ...);
2010-07-05 19:19:29 +03:00
end)
2010-07-22 13:39:48 +03:00
stead.module_init(function()
timer.callback = function(s)
return 'user_timer'
end
end)
2010-07-06 13:15:27 +03:00
-- vim:ts=4