mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-08 16:08:07 -06:00
Attempt to fix reported crash __cybersyn__/scripts/gui/stations.lua:110: bad argument #2 of 3 to 'btest' (number expected, got nil)
This commit is contained in:
@@ -78,7 +78,7 @@ function inventory_tab.build(map_data, player_data)
|
|||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
::has_match::
|
::has_match::
|
||||||
local train_flag = get_network_flag(station, search_network_name)
|
local train_flag = get_network_flag(station, station.network_name)
|
||||||
if not bit32.btest(search_network_mask, train_flag) then
|
if not bit32.btest(search_network_mask, train_flag) then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -100,14 +100,14 @@ function stations_tab.build(map_data, player_data)
|
|||||||
|
|
||||||
if search_network_name then
|
if search_network_name then
|
||||||
--setting default for GUI to NETWORK_EACH, which will match all
|
--setting default for GUI to NETWORK_EACH, which will match all
|
||||||
if search_network_name == (NETWORK_EACH or NETWORK_ANYTHING) then
|
if search_network_name == (NETWORK_EACH or NETWORK_ANYTHING) then --NETWORK_ANYTHING prevents crash due station having a nil issue, may need to be addressed in a different way
|
||||||
goto has_match
|
goto has_match
|
||||||
end
|
end
|
||||||
if search_network_name ~= station.network_name then
|
if search_network_name ~= station.network_name then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
::has_match::
|
::has_match::
|
||||||
local train_flag = get_network_flag(station, search_network_name)
|
local train_flag = get_network_flag(station, station.network_name) --we already validated search network name or a "match anything"
|
||||||
if not bit32.btest(search_network_mask, train_flag) then
|
if not bit32.btest(search_network_mask, train_flag) then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user