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:
@@ -18,7 +18,7 @@ end
|
||||
--- @param surface LuaSurface
|
||||
--- @param position MapPosition.struct
|
||||
local function degrade_tile(surface, position)
|
||||
local tile = surface.get_tile(position)
|
||||
local tile = surface.get_tile(position.x, position.y)
|
||||
local tile_name = tile.name
|
||||
local degrade_tile_name = config.degrade_order[tile_name]
|
||||
if not degrade_tile_name then return end
|
||||
@@ -61,7 +61,7 @@ end
|
||||
--- @param position MapPosition.struct
|
||||
--- @return number?
|
||||
local function get_tile_strength(surface, position)
|
||||
local tile = surface.get_tile(position)
|
||||
local tile = surface.get_tile(position.x, position.y)
|
||||
local tile_name = tile.name
|
||||
local strength = config.strengths[tile_name]
|
||||
if not strength then return end
|
||||
|
||||
Reference in New Issue
Block a user