mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Fix arity and return value mismatches
`assert` returns every argument it is given, so `return assert(x, msg)` was leaking the message as a second return value. `get_tile` is documented as taking x and y. The async function class declared `@operator call` with no parameters, which made every async call look over supplied. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -166,7 +166,7 @@ local function clear_spawn_area(surface, offset)
|
||||
local get_tile = surface.get_tile
|
||||
|
||||
-- Make sure a non water tile is used for filling
|
||||
local starting_tile = get_tile(offset)
|
||||
local starting_tile = get_tile(offset.x, offset.y)
|
||||
local fill_tile = starting_tile.collides_with("player") and "landfill" or starting_tile.name
|
||||
local fill_radius = config.spawn_area.landfill_radius
|
||||
local fill_radius_sqr = fill_radius ^ 2
|
||||
@@ -186,7 +186,7 @@ local function clear_spawn_area(surface, offset)
|
||||
if dst < tile_radius_sqr then
|
||||
-- If it is inside the decon radius always set the tile
|
||||
tiles_to_make[#tiles_to_make + 1] = { name = decon_tile, position = pos }
|
||||
elseif dst < fill_radius_sqr and get_tile(pos).collides_with("player") then
|
||||
elseif dst < fill_radius_sqr and get_tile(pos.x, pos.y).collides_with("player") then
|
||||
-- If it is inside the fill radius only set the tile if it is water
|
||||
tiles_to_make[#tiles_to_make + 1] = { name = fill_tile, position = pos }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user