@@ -31,9 +31,9 @@ -- a 'disjoin' field it must be a function called when they are removed -- from the list of spell targets. -- * caster is the individual who cast the spell, if any. a disjunction -- against their person will totally disrupt the spell. -local log = function(...) sorcery.log('spell',...) end +local log = sorcery.logger 'spell' -- FIXME saving object refs is iffy, find a better alternative sorcery.spell = { active = {} @@ -227,9 +227,9 @@ t = (s.duration * (when.whence or 0)) + when.secs end if t then return math.min(s.duration,math.max(0,t)) end - log('invalid timespec ' .. dump(when)) + log.err('invalid timespec ' .. dump(when)) return 0 end s.queue = function(when,fn) local elapsed = s.starttime and minetest.get_server_uptime() - s.starttime or 0 @@ -237,9 +237,9 @@ if not timepast then timepast = 0 end local timeleft = s.duration - timepast local howlong = (s.delay + timepast) - elapsed if howlong < 0 then - log('cannot time-travel! queue() called with `when` specifying timepoint that has already passed') + log.err('cannot time-travel! queue() called with `when` specifying timepoint that has already passed') howlong = 0 end s.jobs[#s.jobs+1] = minetest.after(howlong, function() -- this is somewhat awkward. since we're using a non-polling approach, we @@ -337,9 +337,9 @@ if s.terminate then s:terminate() end sorcery.spell.active[myid] = nil end) else - log('multiple final timeline events not possible, ignoring') + log.warn('multiple final timeline events not possible, ignoring') end elseif when == 0 and s.disjunction then startqueued = true s.queue(when_raw,function(...)