Compare commits

...

3 Commits

Author SHA1 Message Date
orwell 29180f0f60 Wall signals: make them a bit bigger again 2024-07-20 21:21:55 +02:00
orwell 69e4b8f99a Support signal aspect selection for routes again 2024-07-20 21:04:17 +02:00
orwell baa50c0392 ARS supports triggering distant signal, other bugfixes 2024-07-20 18:02:33 +02:00
22 changed files with 1867 additions and 1770 deletions

View File

@ -48,7 +48,7 @@ local params = {
ZONE_HOLD = 5, -- added on top of ZONE_ROLL ZONE_HOLD = 5, -- added on top of ZONE_ROLL
ZONE_VSLOW = 3, -- When speed is <2, still allow accelerating ZONE_VSLOW = 3, -- When speed is <2, still allow accelerating
DST_FACTOR = 1.5, DST_FACTOR = 3,--1.5,
SHUNT_SPEED_MAX = advtrains.SHUNT_SPEED_MAX, SHUNT_SPEED_MAX = advtrains.SHUNT_SPEED_MAX,
} }

View File

@ -256,7 +256,7 @@ function advtrains.path_get(train, index)
if next_connmap then -- only needs to be done when this track is a turnout (>2 conns) if next_connmap then -- only needs to be done when this track is a turnout (>2 conns)
local origin_conn = train.path_ori_cp[advtrains.encode_pos(adj_pos)] local origin_conn = train.path_ori_cp[advtrains.encode_pos(adj_pos)]
if origin_conn then if origin_conn then
atdebug("Train",train.id,"at",adj_pos,"restoring turnout origin CP",origin_conn,"for path item",index) --atdebug("Train",train.id,"at",adj_pos,"restoring turnout origin CP",origin_conn,"for path item",index)
mconnid = origin_conn mconnid = origin_conn
end end
end end

View File

@ -288,8 +288,8 @@ minetest.register_craftitem("advtrains:trackworker",{
advtrains.ndb.swap_node(pos, new_node) advtrains.ndb.swap_node(pos, new_node)
end end
end, end,
on_use=function(itemstack, user, pointed_thing) on_use=function(itemstack, player, pointed_thing)
local name = user:get_player_name() local name = player:get_player_name()
if not name then if not name then
return return
end end
@ -305,7 +305,7 @@ minetest.register_craftitem("advtrains:trackworker",{
local ndef = minetest.registered_nodes[node.name] local ndef = minetest.registered_nodes[node.name]
if not ndef.advtrains or not ndef.advtrains.trackworker_next_var then if not ndef.advtrains or not ndef.advtrains.trackworker_next_var then
minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be changed using the trackworker!")) minetest.chat_send_player(name, attrans("This node can't be changed using the trackworker!"))
return return
end end
@ -318,7 +318,7 @@ minetest.register_craftitem("advtrains:trackworker",{
if reason then if reason then
str = str .. " " .. reason str = str .. " " .. reason
end end
minetest.chat_send_player(placer:get_player_name(), str) minetest.chat_send_player(name, str)
return return
end end
end end

View File

@ -865,7 +865,7 @@ local function tnc_call_enter_callback(pos, train_id, train, index)
-- check for split points -- check for split points
if mregnode and mregnode.at_conn_map then if mregnode and mregnode.at_conn_map then
-- If this node has >2 conns (and a connmap), remember the connection where we came from to handle split points -- If this node has >2 conns (and a connmap), remember the connection where we came from to handle split points
atdebug("Train",train_id,"at",pos,"saving turnout origin CP",train.path_cp[index],"for path item",index) --atdebug("Train",train_id,"at",pos,"saving turnout origin CP",train.path_cp[index],"for path item",index)
train.path_ori_cp[advtrains.encode_pos(pos)] = train.path_cp[index] train.path_ori_cp[advtrains.encode_pos(pos)] = train.path_cp[index]
end end
end end
@ -883,7 +883,7 @@ local function tnc_call_leave_callback(pos, train_id, train, index)
-- split points do not matter anymore. clear them -- split points do not matter anymore. clear them
if mregnode and mregnode.at_conn_map then if mregnode and mregnode.at_conn_map then
-- If this node has >2 conns (and a connmap), remember the connection where we came from to handle split points -- If this node has >2 conns (and a connmap), remember the connection where we came from to handle split points
atdebug("Train",train_id,"at",pos,"removing turnout origin CP for path item",index," because train has left it") --atdebug("Train",train_id,"at",pos,"removing turnout origin CP for path item",index," because train has left it")
train.path_ori_cp[advtrains.encode_pos(pos)] = nil train.path_ori_cp[advtrains.encode_pos(pos)] = nil
end end
end end
@ -1188,7 +1188,7 @@ function advtrains.invert_train(train_id)
local pos = advtrains.path_get(train, index) local pos = advtrains.path_get(train, index)
local ok, conns, railheight, connmap = advtrains.get_rail_info_at(pos) local ok, conns, railheight, connmap = advtrains.get_rail_info_at(pos)
if ok and connmap then if ok and connmap then
atdebug("Reversing Train",train.id," ori_cp Checks: at",pos,"saving turnout origin CP",train.path_cn[index],"for path item",index) --atdebug("Reversing Train",train.id," ori_cp Checks: at",pos,"saving turnout origin CP",train.path_cn[index],"for path item",index)
ori_cp_after_flip[advtrains.encode_pos(pos)] = train.path_cn[index] ori_cp_after_flip[advtrains.encode_pos(pos)] = train.path_cn[index]
end end
end end

View File

@ -64,10 +64,7 @@ advtrains.tnc_register_on_approach(function(pos, id, train, index, has_entered,
-- resetting the path does not matter to the set route and ARS doesn't need to be called again. -- resetting the path does not matter to the set route and ARS doesn't need to be called again.
if spos and ars_enabled then if spos and ars_enabled then
--atdebug(id,"IL Spos (ARS)",spos,asp) --atdebug(id,"IL Spos (ARS)",spos,asp)
local sigd = il.db.get_sigd_for_signal(spos) il.ars_check(spos, train)
if sigd then
il.ars_check(sigd, train)
end
end end
--atdebug("trav: ",pos, cn, asp, spos, "travsht=", lzb.travsht) --atdebug("trav: ",pos, cn, asp, spos, "travsht=", lzb.travsht)
local lspd local lspd

View File

@ -129,9 +129,24 @@ function il.ars_check_rule_match(ars, train)
return nil return nil
end end
function advtrains.interlocking.ars_check(sigd, train) function advtrains.interlocking.ars_check(signalpos, train, trig_from_dst)
local tcbs = il.db.get_tcbs(sigd) -- check for distant signal
if not tcbs or not tcbs.routes then return end -- this whole check must be delayed until after the route setting has taken place,
-- because before that the distant signal is yet unknown
if not trig_from_dst then
minetest.after(0.5, function()
-- does signal have dst?
local _, remote = il.signal.get_aspect(signalpos)
if remote then
advtrains.interlocking.ars_check(remote, train, true)
end
end)
end
local sigd = il.db.get_sigd_for_signal(signalpos)
local tcbs = sigd and il.db.get_tcbs(sigd)
-- trigger ARS on this signal
if tcbs and tcbs.routes then
if tcbs.ars_disabled or tcbs.ars_ignore_next then if tcbs.ars_disabled or tcbs.ars_ignore_next then
-- No-ARS mode of signal. -- No-ARS mode of signal.
@ -140,6 +155,10 @@ function advtrains.interlocking.ars_check(sigd, train)
tcbs.ars_ignore_next = nil tcbs.ars_ignore_next = nil
return return
end end
if trig_from_dst and tcbs.no_dst_ars_trig then
-- signal not to be triggered from distant
return
end
if tcbs.routeset then if tcbs.routeset then
-- ARS is not in effect when a route is already set -- ARS is not in effect when a route is already set
@ -155,3 +174,4 @@ function advtrains.interlocking.ars_check(sigd, train)
minetest.after(0, il.route.update_route, sigd, tcbs, rteid, nil) minetest.after(0, il.route.update_route, sigd, tcbs, rteid, nil)
end end
end end
end

View File

@ -254,6 +254,13 @@ routes = {
ars = { <ARS rule definition table> } ars = { <ARS rule definition table> }
use_rscache = false -- if true, the track section's rs_cache will be used to set locks in addition to the locks table use_rscache = false -- if true, the track section's rs_cache will be used to set locks in addition to the locks table
-- this is disabled for legacy routes, but enabled for all new routes by default -- this is disabled for legacy routes, but enabled for all new routes by default
-- Fields to specify the signal aspect of the signal
main_aspect = "_free" -- The main aspect that the route start signal is to show
assign_dst = false -- Whether to assign distant signal (affects only the signal at the start of the route)
-- false: start signal does not set distant signal (the default), for long blocks
-- it is assumed that the next main signal will have its own distant sig
-- true: start signal sets distant signal to the next signal on the route with route_role "main" (typically the end signal)
-- for short blocks where end signal doesn't have its own distant sig
-- Fields used by the autorouter: -- Fields used by the autorouter:
ar_end_sigd = <sigd> -- the sigd describing the end of the route. Used for merging route options on recalculation ar_end_sigd = <sigd> -- the sigd describing the end of the route. Used for merging route options on recalculation
} }

View File

@ -209,7 +209,7 @@ function advtrains.interlocking.visualize_route(origin, route, context, tmp_lcks
end end
-- display locks set by player -- display locks set by player
for pts, state in pairs(tmp_lcks) do for pts, state in pairs(tmp_lcks) do
local pos = minetest.string_to_pos(pts) local pos = advtrains.decode_pos(pts)
routesprite(context, pos, "fixp"..pts, "at_il_route_lock_edit.png", "Fixed in state '"..state.."' by route "..route.name.." (punch to unfix)", routesprite(context, pos, "fixp"..pts, "at_il_route_lock_edit.png", "Fixed in state '"..state.."' by route "..route.name.." (punch to unfix)",
function() clear_lock(tmp_lcks, pname, pts) end) function() clear_lock(tmp_lcks, pname, pts) end)
end end
@ -536,7 +536,7 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
return return
end end
if advtrains.is_passive(pos) then if advtrains.is_passive(pos) then
local pts = advtrains.roundfloorpts(pos) local pts = advtrains.encode_pos(pos)
if rp.tmp_lcks[pts] then if rp.tmp_lcks[pts] then
clear_lock(rp.tmp_lcks, pname, pts) clear_lock(rp.tmp_lcks, pname, pts)
else else

View File

@ -3,6 +3,7 @@
local atil = advtrains.interlocking local atil = advtrains.interlocking
local ildb = atil.db local ildb = atil.db
local F = advtrains.formspec
-- TODO duplicate -- TODO duplicate
local lntrans = { "A", "B" } local lntrans = { "A", "B" }
@ -83,9 +84,32 @@ function atil.show_route_edit_form(pname, sigd, routeid)
itab("E (none)") itab("E (none)")
end end
form = form.."textlist[0.5,2;3,3.9;rtelog;"..table.concat(tab, ",").."]" form = form.."textlist[0.5,2;3.5,3.9;rtelog;"..table.concat(tab, ",").."]"
-- to the right of rtelog a signal aspect selection for the start signal
form = form..F.label(4.5, 2, "Signal Aspect:")
-- main aspect list
local signalpos = tcbs.signal
local ndef = signalpos and advtrains.ndb.get_ndef(signalpos)
if ndef and ndef.advtrains and ndef.advtrains.main_aspects then
local entries = { "<Default Aspect>" }
local sel = 1
for i, mae in ipairs(ndef.advtrains.main_aspects) do
entries[i+1] = mae.description
if mae.name == route.main_aspect then
sel = i+1
end
end
form = form..F.dropdown(4.5, 3.0, 4, "sa_main_aspect", entries, sel, true)
-- checkbox for assign distant signal
form = form..string.format("checkbox[4.5,4.0;sa_distant;Announce distant signal;%s]", route.assign_dst)
end
form = form.."button[0.5,6;1,1;prev;<<<]"
form = form.."button[1.5,6;1,1;back;Back]"
form = form.."button[2.5,6;1,1;next;>>>]"
form = form.."button[0.5,6;3,1;back;<<< Back to signal]"
if route.smartroute_generated then if route.smartroute_generated then
form = form.."button[3.5,6;2,1;noautogen;Clr Autogen]" form = form.."button[3.5,6;2,1;noautogen;Clr Autogen]"
end end
@ -123,20 +147,32 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local route = tcbs.routes[routeid] local route = tcbs.routes[routeid]
if not route then return end if not route then return end
if fields.prev then
atil.show_route_edit_form(pname, sigd, routeid - 1)
return
end
if fields.next then
atil.show_route_edit_form(pname, sigd, routeid + 1)
return
end
if fields.setname and fields.name then if fields.setname and fields.name then
route.name = fields.name route.name = fields.name
end end
if fields.aspect then if fields.sa_main_aspect then
local suppasp = advtrains.interlocking.signal_get_supported_aspects(tcbs.signal) local idx = tonumber(fields.sa_main_aspect)
route.main_aspect = nil
local callback = function(pname, asp) if idx > 1 then
route.aspect = asp local signalpos = tcbs.signal
advtrains.interlocking.show_route_edit_form(pname, sigd, routeid) local ndef = signalpos and advtrains.ndb.get_ndef(signalpos)
if ndef and ndef.advtrains and ndef.advtrains.main_aspects then
route.main_aspect = ndef.advtrains.main_aspects[idx - 1].name
end end
end
advtrains.interlocking.show_signal_aspect_selector(pname, suppasp, route.name, callback, route.aspect or advtrains.interlocking.GENERIC_FREE) end
return if fields.sa_distant then
route.assign_dst = minetest.is_yes(fields.sa_distant)
end end
if fields.noautogen then if fields.noautogen then

View File

@ -92,8 +92,8 @@ function ilrs.set_route(signal, route, try)
end end
-- add all from locks, these override the rscache -- add all from locks, these override the rscache
for lpts,lst in pairs(c_rseg.locks) do for lpts,lst in pairs(c_rseg.locks) do
atdebug("Add lock from Routedef:",lp,"->",lst,"overrides",c_locks[lp] or "none") atdebug("Add lock from Routedef:",lpts,"->",lst,"overrides",c_locks[lpts] or "none")
c_locks[lp] = lst c_locks[lpts] = lst
end end
for lp, state in pairs(c_locks) do for lp, state in pairs(c_locks) do
@ -147,7 +147,7 @@ function ilrs.set_route(signal, route, try)
tcbs_ref = c_tcbs, tcbs_ref = c_tcbs,
role = ndef and ndef.advtrains and ndef.advtrains.route_role, role = ndef and ndef.advtrains and ndef.advtrains.route_role,
masp_override = c_rseg.masp_override, --TODO implement masp_override on UI side masp_override = c_rseg.masp_override, --TODO implement masp_override on UI side
dst_type = "next_main", --TODO allow user differentiate assign_dst = (i~=1) or route.assign_dst -- Behavior: for first signal assign depending on route.assign_dst, all others always assign
} }
signals[#signals+1] = sig_table signals[#signals+1] = sig_table
end end
@ -171,11 +171,19 @@ function ilrs.set_route(signal, route, try)
-- note the signals are iterated backwards. Switch depending on the role -- note the signals are iterated backwards. Switch depending on the role
local sig = signals[i] local sig = signals[i]
-- apply mainaspect -- apply mainaspect
sig.tcbs_ref.route_aspect = sig.masp_override or "_default" sig.tcbs_ref.route_aspect = sig.masp_override or route.main_aspect or "_default"
if sig.role == "distant" or sig.role == "distant_repeater" or sig.role == "main_distant" then if sig.role == "distant" or sig.role == "distant_repeater" or sig.role == "main_distant" then
-- assign the remote as the last mainsig if last_mainsig then
-- assign the remote as the last mainsig if desired
if sig.assign_dst then
sig.tcbs_ref.route_remote = last_mainsig sig.tcbs_ref.route_remote = last_mainsig
end end
-- if it wasn't a distant_repeater clear the mainsig
if sig.role ~= "distant_repeater" then
last_mainsig = false
end
end
end
if sig.role == "main" or sig.role == "main_distant" or sig.role == "end" then if sig.role == "main" or sig.role == "main_distant" or sig.role == "end" then
-- record this as the new last mainsig -- record this as the new last mainsig
last_mainsig = sig.pos last_mainsig = sig.pos

View File

@ -100,7 +100,8 @@ ndef.advtrains = {
-- Determines how the signal behaves when routes are set. Only in effect when signal is assigned to a TCB. -- Determines how the signal behaves when routes are set. Only in effect when signal is assigned to a TCB.
-- main: The signal is a possible endpoint for a train move route. Distant signals before it refer to it. -- main: The signal is a possible endpoint for a train move route. Distant signals before it refer to it.
-- shunt: The signal is a possible endpoint for a shunt move route. Ignored for distant signals. -- shunt: The signal is a possible endpoint for a shunt move route. Ignored for distant signals.
-- distant, distant_repeater: When route is set, signal is always assigned its first main aspect. The next signal with role="main" is set as the remote signal. (currently no further distinction) -- distant, distant_repeater: The next signal with role="main" is set as the remote signal. main_aspects may be undefined, the main aspect passed to apply_aspect is a dummy one in this case.
-- distant: if more than one distant signal is before a main signal, only the last one is assigned (but any number of distant_repeater signals are allowed)
-- main_distant: Combination of main and distant - like "main", but additionally gets assigned to the next main like a "distant" -- main_distant: Combination of main and distant - like "main", but additionally gets assigned to the next main like a "distant"
-- end: like main, but signifies that it marks an end of track and trains cannot continue further. (currently no practical implications above main) -- end: like main, but signifies that it marks an end of track and trains cannot continue further. (currently no practical implications above main)
} }
@ -279,7 +280,7 @@ end
function signal.get_aspect(pos) function signal.get_aspect(pos)
local aspt = signal.aspects[advtrains.encode_pos(pos)] local aspt = signal.aspects[advtrains.encode_pos(pos)]
local ma,dp = signal.get_aspect_internal(pos, aspt) local ma,dp = signal.get_aspect_internal(pos, aspt)
return ma, advtrains.decode_pos(dp) return ma, dp and advtrains.decode_pos(dp)
end end
local function cache_mainaspects(ndefat) local function cache_mainaspects(ndefat)

View File

@ -645,6 +645,7 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle
form = form.."button[0.5,8;2.5,1;smartroute;Smart Route]" form = form.."button[0.5,8;2.5,1;smartroute;Smart Route]"
form = form.."button[ 3,8;2.5,1;newroute;New (Manual)]" form = form.."button[ 3,8;2.5,1;newroute;New (Manual)]"
form = form..string.format("checkbox[0.5,8.75;ars;Automatic routesetting;%s]", not tcbs.ars_disabled) form = form..string.format("checkbox[0.5,8.75;ars;Automatic routesetting;%s]", not tcbs.ars_disabled)
form = form..string.format("checkbox[0.5,9.25;dstarstrig;Distant signal triggers ARS;%s]", not tcbs.no_dst_ars_trig)
end end
elseif sigd_equal(tcbs.route_origin, sigd) then elseif sigd_equal(tcbs.route_origin, sigd) then
-- something has gone wrong: tcbs.routeset should have been set... -- something has gone wrong: tcbs.routeset should have been set...
@ -669,7 +670,7 @@ end
function advtrains.interlocking.update_player_forms(sigd) function advtrains.interlocking.update_player_forms(sigd)
for pname, tsigd in pairs(p_open_sig_form) do for pname, tsigd in pairs(p_open_sig_form) do
if advtrains.interlocking.sigd_equal(sigd, tsigd) then if advtrains.interlocking.sigd_equal(sigd, tsigd) then
advtrains.interlocking.show_signalling_form(sigd, pname, nil) advtrains.interlocking.show_signalling_form(sigd, pname, nil, true)
end end
end end
end end
@ -761,6 +762,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
tcbs.ars_disabled = not minetest.is_yes(fields.ars) tcbs.ars_disabled = not minetest.is_yes(fields.ars)
end end
if fields.dstarstrig then
tcbs.no_dst_ars_trig = not minetest.is_yes(fields.dstarstrig)
end
if fields.auto then if fields.auto then
tcbs.route_auto = true tcbs.route_auto = true
end end

View File

@ -75,7 +75,10 @@ local function setsection(tid, train, ts_id, ts, sigd)
end end
-- routes -- routes
local tcbs = advtrains.interlocking.db.get_tcbs(sigd) local tcbs
if sigd then
tcbs = advtrains.interlocking.db.get_tcbs(sigd)
end
-- route setting - clear route state -- route setting - clear route state
if ts.route then if ts.route then
@ -90,7 +93,7 @@ local function setsection(tid, train, ts_id, ts, sigd)
end end
ts.route = nil ts.route = nil
end end
if tcbs.signal then if tcbs and tcbs.signal then
-- Reset route and signal -- Reset route and signal
-- Note that the hit-route case is already handled by cancel_route_from -- Note that the hit-route case is already handled by cancel_route_from
-- this code only handles signal at entering tcb and also triggers for non-route ts -- this code only handles signal at entering tcb and also triggers for non-route ts

View File

@ -258,16 +258,16 @@ for _, rtab in ipairs({
-- Vorsignal (NEU!) -- Vorsignal (NEU!)
for typ, prts in pairs({ for typ, prts in pairs({
-- note: the names are taken from the main signal equivalent so that the same names for the lamp images can be used -- note: the names are taken from the main signal equivalent so that the same names for the lamp images can be used
slow = {asp = advtrains.interlocking.signal.ASPI_HALT, n = "nextslow", ici=true}, slow = {asp = function(pos) return { dst = 0, shunt = true } end, n = "nextslow", ici=true},
nextslow = { nextslow = {
asp = function(pos) asp = function(pos)
return { dst = getzs3v(pos) or 6 } return { dst = getzs3v(pos) or 6, shunt = true }
end, end,
n = "free" n = "free"
}, },
free = { free = {
asp = function(pos) asp = function(pos)
return { dst = -1 } return { dst = -1, shunt = true }
end, end,
n = "slow" n = "slow"
}, },
@ -399,7 +399,9 @@ for _, rtab in ipairs({
drop = "advtrains_signals_ks:"..prefix.."_"..dtyp.."_0", drop = "advtrains_signals_ks:"..prefix.."_"..dtyp.."_0",
inventory_image = inv, inventory_image = inv,
advtrains = { advtrains = {
get_aspect_info = asp get_aspect_info = asp,
trackworker_next_rot = "advtrains_signals_ks:"..prefix.."_"..typ.."_"..rtab.nextrot,
trackworker_rot_incr_param2 = (rot=="60")
}, },
on_rightclick = advtrains.interlocking.signal_rc_handler, on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig, can_dig = advtrains.interlocking.signal_can_dig,
@ -506,6 +508,10 @@ for _, rtab in ipairs({
t.mesh = "advtrains_signals_ks_zs_top_smr"..rot..".obj" t.mesh = "advtrains_signals_ks_zs_top_smr"..rot..".obj"
t.drop = "advtrains_signals_ks:zs3_off_0" t.drop = "advtrains_signals_ks:zs3_off_0"
t.selection_box.fixed[1][5] = 0 t.selection_box.fixed[1][5] = 0
t.advtrains = {
trackworker_next_rot = "advtrains_signals_ks:zs3_"..typ.."_"..rtab.nextrot,
trackworker_rot_incr_param2 = (rot=="60")
},
minetest.register_node("advtrains_signals_ks:zs3_"..typ.."_"..rot, t) minetest.register_node("advtrains_signals_ks:zs3_"..typ.."_"..rot, t)
--TODO add rotation using trackworker --TODO add rotation using trackworker
@ -515,6 +521,10 @@ for _, rtab in ipairs({
t.mesh = "advtrains_signals_ks_zs_bottom_smr"..rot..".obj" t.mesh = "advtrains_signals_ks_zs_bottom_smr"..rot..".obj"
t.drop = "advtrains_signals_ks:zs3v_off_0" t.drop = "advtrains_signals_ks:zs3v_off_0"
t.tiles[3] = t.tiles[3] .. "^[multiply:yellow" t.tiles[3] = t.tiles[3] .. "^[multiply:yellow"
t.advtrains = {
trackworker_next_rot = "advtrains_signals_ks:zs3v_"..typ.."_"..rtab.nextrot,
trackworker_rot_incr_param2 = (rot=="60")
},
minetest.register_node("advtrains_signals_ks:zs3v_"..typ.."_"..rot, t) minetest.register_node("advtrains_signals_ks:zs3v_"..typ.."_"..rot, t)
--TODO add rotation using trackworker --TODO add rotation using trackworker
end end
@ -539,6 +549,10 @@ for _, rtab in ipairs({
not_blocking_trains = 1, not_blocking_trains = 1,
not_in_creative_inventory = (rtab.ici) and 0 or 1, not_in_creative_inventory = (rtab.ici) and 0 or 1,
}, },
advtrains = {
trackworker_next_rot = "advtrains_signals_ks:mast_mast_"..rtab.nextrot,
trackworker_rot_incr_param2 = (rot=="60")
},
drop = "advtrains_signals_ks:mast_mast_0", drop = "advtrains_signals_ks:mast_mast_0",
}) })
--TODO add rotation using trackworker --TODO add rotation using trackworker

View File

@ -46,7 +46,7 @@ local function applyaspect_distant(loc)
end end
for r,f in pairs(all_sigs) do for r,f in pairs(all_sigs) do
for loc, sbox in pairs({l={-1/2, -1/4, -1/8, -1/4, 1/4, 1/8}, r={1/4, -1/4, -1/8, 1/2, 1/4, 1/8}, t={-1/4, 1/4, -1/8, 1/4, 1/2, 1/8}}) do for loc, sbox in pairs({l={-1/2, -1/2, -1/4, 0, 1/2, 1/4}, r={0, -1/2, -1/4, 1/2, 1/2, 1/4}, t={-1/2, 0, -1/4, 1/2, 1/2, 1/4}}) do
minetest.register_node("advtrains_signals_muc_ubahn:signal_wall_"..loc.."_"..r, { minetest.register_node("advtrains_signals_muc_ubahn:signal_wall_"..loc.."_"..r, {
drawtype = "mesh", drawtype = "mesh",
paramtype="light", paramtype="light",

Binary file not shown.

Binary file not shown.

Binary file not shown.