From 9d5f9543f41096a55e5c6df1d09ff97a0b1fc71c Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Sun, 18 Apr 2010 15:06:36 -0500 Subject: [PATCH] Changed handling of "x by y" to be more strict --- Regexps.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Regexps.lua b/Regexps.lua index ac083e0..63ddb51 100644 --- a/Regexps.lua +++ b/Regexps.lua @@ -836,7 +836,17 @@ SingleStatLines = { end end}, -- Tends to eat other stats if not last - {"^(%a+ ?%a+ ?%a+ ?%a+) by (%d+)$", WeightsWatcher.statNameFirst}, + -- TODO: split this into a separate function instead of recursing? + {"^(%a+ ?%a+ ?%a+ ?%a+) by (%d+)$", + function(text, pattern) + local start, _, name, value = string.find(text, pattern) + if start then + local stats = WeightsWatcher.parseStats(value .. " " .. name) + if stats then + return stats + end + end + end}, {"^a minor movement speed increase$", function(text, pattern) -- 1.7.9.5