fixed spamming of manti spear

René Welbers [01-28-16 - 21:10]
fixed spamming of manti spear
Filename
RaidNotifier.lua
RaidNotifier.txt
diff --git a/RaidNotifier.lua b/RaidNotifier.lua
index 8b30889..7796015 100644
--- a/RaidNotifier.lua
+++ b/RaidNotifier.lua
@@ -5,7 +5,7 @@ RaidNotifier = RaidNotifier or {}

 RaidNotifier.name		   = 'RaidNotifier'
 RaidNotifier.slash		   = '/rn'
-RaidNotifier.version	   = '1.3.6'
+RaidNotifier.version	   = '1.3.7'
 RaidNotifier.versionDB	   = 1
 RaidNotifier.loaded	       = false
 RaidNotifier.author        = 'silentgecko'
@@ -438,6 +438,8 @@ function RaidNotifier.receivePing(_, pingEventType, _, pingTag, offsetX, offsetY
     local realEventCode   = realEventCodes.mantikora_spear -- atm we only have this one, @todo iterate over them and then switch for the different alerts
     local zosEventCodeMin = realEventCode - 100
     local zosEventCodeMax = realEventCode + 100
+    local lastPing        = self.tempVars.last_ping
+    local lastPingDiff    = GetDiffBetweenTimeStamps(currentTime, lastPing)

     -- make sure we have a correct eventCode
     -- the pingmap make some rounding errors, so we have to define a range and check if the ping is inside this range
@@ -448,7 +450,9 @@ function RaidNotifier.receivePing(_, pingEventType, _, pingTag, offsetX, offsetY
         -- set last ping to now to prevent spamming
         self.tempVars.last_ping = currentTime

-        CENTER_SCREEN_ANNOUNCE:AddMessage(10, CSA_EVENT_SMALL_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_SANCTUM_MANTIKORA_SPEAR_PLAYER), unitName))
+        if lastPingDiff > 5 then
+            CENTER_SCREEN_ANNOUNCE:AddMessage(10, CSA_EVENT_SMALL_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_SANCTUM_MANTIKORA_SPEAR_PLAYER), unitName))
+        end
     end
 end

diff --git a/RaidNotifier.txt b/RaidNotifier.txt
index 914b5e3..d9459a8 100644
--- a/RaidNotifier.txt
+++ b/RaidNotifier.txt
@@ -1,7 +1,7 @@
 ## Title: |cEFEBBERaidNotifier|r
 ## Description: Displays on-screen notifications on different events during trials.
 ## Author: |c009ad6silentgecko|r
-## Version: 1.3.6
+## Version: 1.3.7
 ## APIVersion: 100013
 ## SavedVariables: RNVars
 ## OptionalDependsOn: LibAddonMenu-2.0