Fixed bugs
This commit is contained in:
parent
a0f6228b6e
commit
71d24820ed
|
@ -131,6 +131,7 @@ local function handleNearbyStation()
|
|||
end
|
||||
-- Either wait for the user to choose a route, or go away from the
|
||||
-- station transponder.
|
||||
local routeChosen = false
|
||||
parallel.waitForAny(
|
||||
function ()
|
||||
while true do
|
||||
|
@ -141,6 +142,7 @@ local function handleNearbyStation()
|
|||
elseif y > 1 and y - 1 <= #routes then
|
||||
local selectedRoute = routes[y-1]
|
||||
os.queueEvent("rail_route_selected", selectedRoute)
|
||||
routeChosen = true
|
||||
return
|
||||
end
|
||||
end
|
||||
|
@ -148,6 +150,8 @@ local function handleNearbyStation()
|
|||
end,
|
||||
function () waitForNoStation(name) end
|
||||
)
|
||||
-- Quit our main loop if the user has chosen a route.
|
||||
if routeChosen then return end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,8 @@ particular route to another station.
|
|||
|
||||
You should add a "station_config.tbl" file containing:
|
||||
{
|
||||
name = "Station name",
|
||||
name = "stationname",
|
||||
displayName = "Station Name",
|
||||
range = 8,
|
||||
routes = {
|
||||
{name = "First", path = {"A", "B", "C"}},
|
||||
|
@ -50,6 +51,7 @@ local config = readConfig()
|
|||
term.clear()
|
||||
term.setCursorPos(1, 1)
|
||||
print("Running station transponder for \""..config.name.."\".")
|
||||
print(" Display Name: "..config.displayName)
|
||||
print(" Range: "..config.range.." blocks")
|
||||
print(" Routes:")
|
||||
for i, route in pairs(config.routes) do
|
||||
|
|
Loading…
Reference in New Issue