changeset 120:5f1ba488c395

ArtifactPower: - prediction text shows the correct rank when AP cost is currently met
author Nenue
date Sun, 04 Jun 2017 18:20:40 -0400
parents 0f47780a83c4
children 1f68c46bc4de
files Modules/ArtifactPower.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Modules/ArtifactPower.lua	Sat May 20 06:10:52 2017 -0400
+++ b/Modules/ArtifactPower.lua	Sun Jun 04 18:20:40 2017 -0400
@@ -967,11 +967,11 @@
   print('actual:', actualLevel, actualXP, '/', actualCost)
 
 
-  if unusedXP > 0 then
-    local remaining = totalXP + unusedXP
-    local nextCost = artifact.currentCost
+  local remaining = totalXP + unusedXP
+  local nextCost = artifact.currentCost
+  if remaining > nextCost then
     totalCost = nextCost
-    while remaining > nextCost do
+    while remaining >= nextCost do
       totalLevel = totalLevel + 1
       remaining = remaining - nextCost
       nextCost = C_ArtifactUI.GetCostForPointAtRank(totalLevel, artifact.tier)