Skip to content

Commit

Permalink
Merge pull request #6644 from LandSandBoat/disable-rand-ci
Browse files Browse the repository at this point in the history
[ci] Disable math.random style check, restore float parameter calls
  • Loading branch information
claywar authored Jan 3, 2025
2 parents b81a629 + 3bdfebb commit 989c16f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Nyzul_Isle/mobs/Gem_Heister_Roorooroon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Nyzul_Isle/mobs/Stealth_Bomber_Gagaroon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tools/ci/lua_stylecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 989c16f

Please sign in to comment.