cleanup code

René Welbers [01-10-16 - 11:39]
cleanup code
Filename
RaidTimer.lua
RaidTimer.txt
diff --git a/RaidTimer.lua b/RaidTimer.lua
index cc9cdcd..b441754 100644
--- a/RaidTimer.lua
+++ b/RaidTimer.lua
@@ -5,7 +5,7 @@ RaidTimer = {}

 RaidTimer.name		= 'RaidTimer'
 RaidTimer.slash		= '/rt'
-RaidTimer.version	= '1.3.0'
+RaidTimer.version	= '1.3.1'
 RaidTimer.versionDB	= 1
 RaidTimer.loaded	= false
 RaidTimer.author    = 'Noshiz, Garkin & silentgecko'
@@ -309,13 +309,7 @@ function RaidTimer.TimerUpdate()
             end

             local estimatedScore = 0
-            --if self.raidId == 6 then
-                estimatedScore = self.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)
-            --else
-                --old formula
-                --estimatedScore = zo_max(zo_round(((timeLimit - (raidDuration * maxPoints / currentPoints)) * (maxPoints / 1000)) + maxPoints), zo_floor(currentPoints / 100))
-            --end
-
+            estimatedScore = self.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)

             local currentBestScore = self.savedVariables.topScores[self.raidId].score or 0
             local currentBestTime  = self.savedVariables.topScores[self.raidId].time or 0
@@ -355,13 +349,7 @@ function RaidTimer.ScoreUpdate(event, scoreType, scoreAmount, totalScore)

         if timeLimit > 0 and maxPoints > 0 then
             local estimatedScore = 0
-            --if self.raidId == 6 then
-                estimatedScore = self.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)
-            --else
-                --old formula
-                --estimatedScore = zo_max(zo_round(((timeLimit - (raidDuration * maxPoints / currentPoints)) * (maxPoints / 1000)) + maxPoints), zo_floor(currentPoints / 100))
-            --end
-            --local estimatedScore = zo_max(zo_round(((timeLimit - (raidDuration * maxPoints / currentPoints)) * (maxPoints / 1000)) + maxPoints), zo_floor(currentPoints / 100))
+            estimatedScore = self.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)

             local currentBestScore = self.savedVariables.topScores[self.raidId].score or 0
             local currentBestTime  = self.savedVariables.topScores[self.raidId].time or 0
@@ -444,6 +432,8 @@ end

 -------Get Estimated Score--------
 function RaidTimer.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)
+    -- old formula
+    --zo_max(zo_round(((timeLimit - (raidDuration * maxPoints / currentPoints)) * (maxPoints / 1000)) + maxPoints), zo_floor(currentPoints / 100))
     return (currentPoints+((maxPoints)*((timeLimit-raidDuration)/10000)))
 end

diff --git a/RaidTimer.txt b/RaidTimer.txt
index 941dafa..8ce2487 100644
--- a/RaidTimer.txt
+++ b/RaidTimer.txt
@@ -1,6 +1,6 @@
 ## Title: |cEFEBBERaid Timer|r
 ## Author: Noshiz, |cEFEBBEGarkin|r, |c4779cesilentgecko|r
-## Version: 1.3.0
+## Version: 1.3.1
 ## APIVersion: 100013
 ## SavedVariables: RTVars
 ## OptionalDependsOn: LibAddonMenu-2.0