Added a condition for calculating stuff in played dt. This fixes #398
Darth Predator [11-17-16 - 12:45]
Added a condition for calculating stuff in played dt. This fixes #398
diff --git a/ElvUI_SLE/modules/sledatatexts/played.lua b/ElvUI_SLE/modules/sledatatexts/played.lua
index 596fd33..1e1fe3a 100644
--- a/ElvUI_SLE/modules/sledatatexts/played.lua
+++ b/ElvUI_SLE/modules/sledatatexts/played.lua
@@ -117,7 +117,7 @@ local OnEvent = function(self, event, ...)
ElvDB["sle"]["TimePlayed"][MyRealm][MyName]["LevelTime"] = LevelTime
end
if event == 'PLAYER_LEVEL_UP' then
- LastLevelTime = T.floor(LevelPlayTime + (T.GetTime() - LevelPlayTimeOffset))
+ LastLevelTime = T.floor(LevelPlayTime + (T.GetTime() - (LevelPlayTimeOffset or 0)))
ElvDB["sle"]["TimePlayed"][MyRealm][MyName]["LastLevelTime"] = LastLevelTime
LevelPlayTime = 1
LevelPlayTimeOffset = T.GetTime()