ruby: better handling of errors in onupdate callbacks

develop
jj 2012-07-11 23:25:55 +02:00
parent b0edb33023
commit d8e55196c2
1 changed files with 3 additions and 1 deletions

@ -38,15 +38,17 @@ module DFHack
@callback.call
else
if year > @minyear or (year == @minyear and yeartick >= @minyeartick)
@callback.call
@minyear = year
@minyeartick = yeartick + @ticklimit
if @minyeartick > yearlen
@minyear += 1
@minyeartick -= yearlen
end
@callback.call
end
end
rescue
puts_err "onupdate cb #$!", $!.backtrace
end
def <=>(o)