changeset 13:e6eec48ecf14

Minor optimization to the Prospect Me tooltip.
author Geoff Brock <mischivin@gmail.com>
date Wed, 17 Aug 2016 13:58:48 -0400
parents c5a66cdf45e2
children 56a8d7064c9a
files ProspectMe_Tooltip.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ProspectMe_Tooltip.lua	Wed Aug 17 13:51:13 2016 -0400
+++ b/ProspectMe_Tooltip.lua	Wed Aug 17 13:58:48 2016 -0400
@@ -57,6 +57,7 @@
 		if tooltipLink then
 			local item = tooltipLink:match("Hitem:(%d+)")
 			if PM_ResultsTable[item] then
+				local lifetimeReturn = PM_GetReturn(item)
 				--NumofEachQuality, Percent of Each Quality
 				self:AddLine(" ")
 				self:AddLine("Prospect Me",0.5,1,0.5)
@@ -68,8 +69,8 @@
 					self:AddDoubleLine("Cost to Mill: " .. PM_FormatPrice(5 * PM_ItemTable[item].price), " Average Return: " .. PM_FormatPrice(PM_GetReturn(item)))
 
 				end
-				if PM_GetReturn(item)-(5 * PM_ItemTable[item].price) > 0 then
-					self:AddLine("Estimated Profit: " .. PM_FormatPrice(PM_GetReturn(item)-(5 * PM_ItemTable[item].price)))
+				if lifetimeReturn-(5 * PM_ItemTable[item].price) > 0 then
+					self:AddLine("Estimated Profit: " .. PM_FormatPrice(lifetimeReturn-(5 * PM_ItemTable[item].price)))
 					self:AddLine(" ")
 				else
 					self:AddLine("No profit to be made",1,0,0)