Skip to content

Commit

Permalink
Replace buildnum with tocversion to avoid comparing strings as numbers (
Browse files Browse the repository at this point in the history
Fixes #36)
  • Loading branch information
raethkcj committed Jun 21, 2021
1 parent f8adb34 commit 7d3a70b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions libs/StatLogic-1.0/StatLogic-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ local GetShapeshiftForm = GetShapeshiftForm
local GetShapeshiftFormInfo = GetShapeshiftFormInfo
local GetShapeShiftFormID = GetShapeShiftFormID
local GetTalentInfo = GetTalentInfo
wowBuildNo = select(2, GetBuildInfo()) -- need a global for loadstring
local wowBuildNo = wowBuildNo
tocversion = select(4, GetBuildInfo()) -- need a global for loadstring
local tocversion = tocversion

-- Cached GetItemInfo
local GetItemInfoCached = setmetatable({}, { __index = function(self, n)
Expand Down Expand Up @@ -1049,15 +1049,15 @@ local StatModTable = {
["rank"] = {
0.05, 0.10, 0.15,
},
["condition"] = "wowBuildNo < '7382'",
["condition"] = "tocversion < 20300",
},
[2] = {
["tab"] = 3,
["num"] = 6,
["rank"] = {
0.1, 0.2, 0.3,
},
["condition"] = "wowBuildNo >= '7382'",
["condition"] = "tocversion >= 20300",
},
},
-- Druid: Dreamstate (Rank 3) - 1,17
Expand Down Expand Up @@ -1233,7 +1233,7 @@ local StatModTable = {
0.04, 0.08, 0.12, 0.16, 0.2,
},
["buff"] = GetSpellInfo(32356), -- ["Cat Form"],
["condition"] = "wowBuildNo < '7382'",
["condition"] = "tocversion < 20300",
},
[2] = {
["tab"] = 2,
Expand All @@ -1254,7 +1254,7 @@ local StatModTable = {
0.02, 0.04, 0.06, 0.08, 0.1,
},
["buff"] = GetSpellInfo(32356), -- ["Cat Form"],
["condition"] = "wowBuildNo >= '7382'",
["condition"] = "tocversion >= 20300",
},
},
-- Druid: Survival of the Fittest (Rank 3) - 2,16
Expand Down Expand Up @@ -1506,15 +1506,15 @@ local StatModTable = {
["rank"] = {
0.05, 0.1, 0.15,
},
["condition"] = "wowBuildNo < '7382'",
["condition"] = "tocversion < 20300",
},
[2] = {
["tab"] = 1,
["num"] = 12,
["rank"] = {
0.1, 0.2, 0.3,
},
["condition"] = "wowBuildNo >= '7382'",
["condition"] = "tocversion >= 20300",
},
},
-- Mage: Mind Mastery (Rank 5) - 1,22
Expand Down Expand Up @@ -1761,7 +1761,7 @@ local StatModTable = {
["rank"] = {
0.02, 0.04, 0.06, 0.08, 0.1,
},
["condition"] = "wowBuildNo >= '7382'",
["condition"] = "tocversion >= 20300",
},
},
-- Paladin: Divine Intellect (Rank 5) - 1,2
Expand Down Expand Up @@ -1798,15 +1798,15 @@ local StatModTable = {
["rank"] = {
0.05, 0.1, 0.15,
},
["condition"] = "wowBuildNo < '7382'",
["condition"] = "tocversion < 20300",
},
[2] = {
["tab"] = 1,
["num"] = 9,
["rank"] = {
0.1, 0.2, 0.3,
},
["condition"] = "wowBuildNo >= '7382'",
["condition"] = "tocversion >= 20300",
},
},
-- Priest: Spiritual Guidance (Rank 5) - 2,14
Expand Down Expand Up @@ -3701,7 +3701,7 @@ end

-- New mana regen from spirit code for 2.4
local BaseManaRegenPerSpi
if wowBuildNo >= '7897' then
if tocversion >= 20400 then
--[[---------------------------------
{ :GetNormalManaRegenFromSpi(spi, [int], [level])
-------------------------------------
Expand Down

0 comments on commit 7d3a70b

Please sign in to comment.