From 3bdfebb6788893517ad59426bea62af118576e6d Mon Sep 17 00:00:00 2001 From: claywar Date: Fri, 3 Jan 2025 07:50:48 -0500 Subject: [PATCH] [ci] Disable math.random style check, restore float parameter calls --- scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua | 2 +- scripts/zones/Nyzul_Isle/mobs/Gem_Heister_Roorooroon.lua | 2 +- scripts/zones/Nyzul_Isle/mobs/Stealth_Bomber_Gagaroon.lua | 2 +- tools/ci/lua_stylecheck.py | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua b/scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua index 7b40a192e7b..089d0ab808e 100644 --- a/scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua +++ b/scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua @@ -121,7 +121,7 @@ entity.onEventUpdate = function(player, csid, option, npc) player:incrementCharVar('ClammingKitWeight', 10000) else - local dropRate = math.random(0.0, 1.0) -- TODO: Adjust all values to use 0..100 scale as opposed to 0..1 + local dropRate = math.random() -- TODO: Adjust all values to use 0..100 scale as opposed to 0..1 local improvedResults = giveImprovedResults(player) player:updateEvent(player:getCharVar('ClammingKitWeight'), player:getCharVar('ClammingKitSize')) diff --git a/scripts/zones/Nyzul_Isle/mobs/Gem_Heister_Roorooroon.lua b/scripts/zones/Nyzul_Isle/mobs/Gem_Heister_Roorooroon.lua index 9c407e4ec3d..1b2d482d819 100644 --- a/scripts/zones/Nyzul_Isle/mobs/Gem_Heister_Roorooroon.lua +++ b/scripts/zones/Nyzul_Isle/mobs/Gem_Heister_Roorooroon.lua @@ -9,7 +9,7 @@ local entity = {} local function pickRunPoint(mob) mob:setLocalVar('ignore', 1) local distance = math.random(10, 25) - local angle = math.random(0.0, 1.0) * math.pi + local angle = math.random() * math.pi local fromTarget = mob:getTarget() if fromTarget == nil then diff --git a/scripts/zones/Nyzul_Isle/mobs/Stealth_Bomber_Gagaroon.lua b/scripts/zones/Nyzul_Isle/mobs/Stealth_Bomber_Gagaroon.lua index 69b27ee97a3..e1a60cc6f64 100644 --- a/scripts/zones/Nyzul_Isle/mobs/Stealth_Bomber_Gagaroon.lua +++ b/scripts/zones/Nyzul_Isle/mobs/Stealth_Bomber_Gagaroon.lua @@ -9,7 +9,7 @@ local entity = {} local function pickRunPoint(mob) mob:setLocalVar('ignore', 1) local distance = math.random(10, 25) - local angle = math.random(0.0, 1.0) * math.pi + local angle = math.random() * math.pi local fromTarget = mob:getTarget() if fromTarget == nil then diff --git a/tools/ci/lua_stylecheck.py b/tools/ci/lua_stylecheck.py index c0930fab96c..2d1c2c8a276 100644 --- a/tools/ci/lua_stylecheck.py +++ b/tools/ci/lua_stylecheck.py @@ -415,7 +415,9 @@ def run_style_check(self): self.check_no_newline_before_end(code_line) self.check_no_function_decl_padding(code_line) self.check_invalid_enum(code_line) - self.check_random_bounds(code_line) + + # TODO: Disabled until a solution for float parameters to math.random() is found + # self.check_random_bounds(code_line) # Keep track of ID variable assignments and if they are referenced. # TODO: Track each unique variable, and expand this to potentially something @@ -510,7 +512,7 @@ def run_style_check(self): total_errors += LuaStyleCheck(filename).errcount elif target == 'test': total_errors = LuaStyleCheck('tools/ci/tests/stylecheck.lua', show_errors = False).errcount - expected_errors = 85 + expected_errors = 82 else: total_errors = LuaStyleCheck(target).errcount