]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_ctfws/commitdiff
Use strict inequality for message time
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Fri, 23 Feb 2018 23:51:55 +0000 (18:51 -0500)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Fri, 23 Feb 2018 23:51:55 +0000 (18:51 -0500)
Otherwise we were getting too many alerts due to reconnections.
Since we don't use messages for high bandwidth, this is probably fine.

init3.lua

index 612004b1d33003574ade901b22222e0dd61609f1..68916e21467d24530a89644498e118b1cd1581c9 100644 (file)
--- a/init3.lua
+++ b/init3.lua
@@ -113,8 +113,8 @@ nwfnet.onmqtt["init"] = function(c,t,m)
       ctfws_lcd:drawMessage(m)
     else
       mt = tonumber(mt)
-      if (ctfws.startT == nil or ctfws.startT <= mt)
-         and (lastMsgTime == nil or lastMsgTime <= mt)
+      if (ctfws.startT == nil or ctfws.startT <= mt)  -- message for this game
+         and (lastMsgTime == nil or lastMsgTime < mt) -- latest message (strict)
        then
         lastMsgTime = mt
         ctfws_lcd:drawMessage(ms)