diff --git a/src/data/redis/cooldown.js b/src/data/redis/cooldown.js index 28d37ab5..2022834d 100644 --- a/src/data/redis/cooldown.js +++ b/src/data/redis/cooldown.js @@ -21,7 +21,7 @@ const PREFIX = 'cd'; * and returns the number of pixels to set * @param ip ip of request * @param id userId - * @param ranked boolean if increasing rank + * @param ranked boolean if increasing rank (should only be true if logged in) * @param clrIgnore, bcd, pcd, cds information about canvas * @param i, j chunk coordinates * @param pxls Array with offsets of pixels diff --git a/src/data/redis/lua/placePixel.lua b/src/data/redis/lua/placePixel.lua index e177d282..f29fbcfd 100644 --- a/src/data/redis/lua/placePixel.lua +++ b/src/data/redis/lua/placePixel.lua @@ -146,10 +146,10 @@ if pxlcnt > 0 then if KEYS[7] ~= 'nope' then redis.call('zincrby', KEYS[6], pxlcnt, ARGV[6]) redis.call('zincrby', KEYS[7], pxlcnt, ARGV[6]) - -- increase country stats only by registered users - if ARGV[7] ~= 'xx' then - redis.call('zincrby', KEYS[8], pxlcnt, ARGV[7]) - end + end + -- increase country stats + if ARGV[7] ~= 'xx' then + redis.call('zincrby', KEYS[8], pxlcnt, ARGV[7]) end end