potential bug fixed
This commit is contained in:
parent
9b9aa43582
commit
c48edda1f0
22
booking.lua
22
booking.lua
@ -143,17 +143,19 @@ local function on_receive_fields(pos, formname, fields, player)
|
|||||||
elseif fields.button ~= nil then
|
elseif fields.button ~= nil then
|
||||||
local key_str = meta:get_string("key_str")
|
local key_str = meta:get_string("key_str")
|
||||||
local idx = tonumber(fields.button)
|
local idx = tonumber(fields.button)
|
||||||
local tDest = get_station_list(key_str)[idx]
|
if key_str and idx then
|
||||||
if tDest ~= nil then
|
local tDest = get_station_list(key_str)[idx]
|
||||||
-- place booking if not already blocked
|
if tDest ~= nil then
|
||||||
if hyperloop.reserve(key_str, tDest.key_str, player) then
|
-- place booking if not already blocked
|
||||||
hyperloop.data.booking[key_str] = hyperloop.get_key_str(tDest.pos)
|
if hyperloop.reserve(key_str, tDest.key_str, player) then
|
||||||
-- open the pod door
|
hyperloop.data.booking[key_str] = hyperloop.get_key_str(tDest.pos)
|
||||||
hyperloop.open_pod_door(hyperloop.get_station_data(key_str))
|
-- open the pod door
|
||||||
|
hyperloop.open_pod_door(hyperloop.get_station_data(key_str))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- data is corrupt, try an update
|
||||||
|
hyperloop.data.change_counter = hyperloop.data.change_counter + 1
|
||||||
end
|
end
|
||||||
else
|
|
||||||
-- data is corrupt, try an update
|
|
||||||
hyperloop.data.change_counter = hyperloop.data.change_counter + 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user