para module fix

This commit is contained in:
p.kosyh 2010-06-23 14:15:29 +00:00
parent d065df3d2f
commit 22c533ea42
2 changed files with 10 additions and 3 deletions

View file

@ -1,7 +1,15 @@
para_mod = obj {
nam = 'para',
ini = function(s)
s.time = stead.time()
end
}
stead.fmt = stead.hook(stead.fmt, function(f, ...)
local r = f(unpack(arg))
if type(r) == 'string' and stead.tick then
r = r:gsub('\n([^\n])', '<&para;>%1'):gsub('<&para;>', '\n'..txtnb(' '));
if type(r) == 'string' and stead.time() > para_mod.time then
para_mod.time = stead.time()
r = r:gsub('\n([^\n])', '<&para;>%1'):gsub('<&para;>[ \t]*', '\n'..txtnb(' '));
r = r:gsub('^',txtnb(' '))
end
return r;

View file

@ -1762,7 +1762,6 @@ iface = {
r,v = me():action(cmd, unpack(a));
st = true;
end
stead.tick = st
-- here r is action result, v - ret code value
-- st -- game state changed
if st and r == nil and v == true then -- we do nothing