# HG changeset patch # User yellowfive # Date 1405031118 25200 # Node ID bb0c8ce689d1d56a2ba06ef6d99bac3a1e72b9b5 # Parent a7bc121c536dc14499d63f551689fb02979a422b fixed minor bug on startup with new settings diff -r a7bc121c536d -r bb0c8ce689d1 AskMrRobot.lua --- a/AskMrRobot.lua Thu Jul 10 13:20:32 2014 -0700 +++ b/AskMrRobot.lua Thu Jul 10 15:25:18 2014 -0700 @@ -270,22 +270,24 @@ elseif event == "PLAYER_ENTERING_WORLD" then -- delete entries that are more than 10 days old to prevent the table from growing indefinitely - local now = time() - local oldDuration = 60 * 60 * 24 * 10 - local entryTime - repeat - -- parse entry and get time - local parts = {} - for part in string.gmatch(AmrSettings.Logins[1], "([^;]+)") do - tinsert(parts, part) - end - entryTime = tonumber(parts[3]) + if AmrSettings.Logins and #AmrSettings.Logins > 0 then + local now = time() + local oldDuration = 60 * 60 * 24 * 10 + local entryTime + repeat + -- parse entry and get time + local parts = {} + for part in string.gmatch(AmrSettings.Logins[1], "([^;]+)") do + tinsert(parts, part) + end + entryTime = tonumber(parts[3]) - -- entries are in order, remove first entry if it is old - if difftime(now, entryTime) > oldDuration then - tremove(AmrSettings.Logins, 1) - end - until #AmrSettings.Logins == 0 or difftime(now, entryTime) <= oldDuration + -- entries are in order, remove first entry if it is old + if difftime(now, entryTime) > oldDuration then + tremove(AmrSettings.Logins, 1) + end + until #AmrSettings.Logins == 0 or difftime(now, entryTime) <= oldDuration + end -- record the time a player logs in, used to figure out which player logged which parts of their log file local key = AmrRealmName .. ";" .. AmrCharacterName .. ";" diff -r a7bc121c536d -r bb0c8ce689d1 AskMrRobot.toc --- a/AskMrRobot.toc Thu Jul 10 13:20:32 2014 -0700 +++ b/AskMrRobot.toc Thu Jul 10 15:25:18 2014 -0700 @@ -1,7 +1,7 @@ ## Interface: 50400 ## Title: Ask Mr. Robot ## Author: Team Robot, Inc. -## Version: 1.2.14.0 +## Version: 1.2.15.0 ## Notes: Exports/Imports data to/from askmrrobot.com. ## URL: www.askmrrobot.com ## DefaultState: Enabled