~gpcf/advtrains-devel

make all nodes non ground content v1 PROPOSED

Luke aka SwissalpS: 1
 make all nodes non ground content

 9 files changed, 127 insertions(+), 101 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~gpcf/advtrains-devel/patches/50161/mbox | git am -3
Learn more about email & git

[PATCH] make all nodes non ground content Export this patch

see https://github.com/pandorabox-io/pandorabox.io/issues/836

also some trailing whitespace removal
---
 advtrains/misc_nodes.lua                      |   6 +-
 advtrains/signals.lua                         |  13 ++-
 advtrains/tracks.lua                          |  44 ++++----
 advtrains/trainhud.lua                        |  19 ++--
 advtrains_interlocking/demosignals.lua        |   3 +
 advtrains_interlocking/tcb_ts_ui.lua          | 105 +++++++++---------
 advtrains_luaautomation/operation_panel.lua   |   1 +
 advtrains_signals_ks/init.lua                 |  33 +++---
 advtrains_signals_ks/init_degrotate_nodes.lua |   4 +
 9 files changed, 127 insertions(+), 101 deletions(-)

diff --git a/advtrains/misc_nodes.lua b/advtrains/misc_nodes.lua
index bcf7329..60bce98 100644
--- a/advtrains/misc_nodes.lua
+++ b/advtrains/misc_nodes.lua
@@ -2,7 +2,7 @@

function advtrains.register_platform(modprefix, preset)
	local ndef=minetest.registered_nodes[preset]
	if not ndef then 
	if not ndef then
		minetest.log("warning", " register_platform couldn't find preset node "..preset)
		return
	end
@@ -16,6 +16,7 @@ function advtrains.register_platform(modprefix, preset)
		description = attrans("@1 Platform (low)", desc),
		tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex},
		groups = {cracky = 1, not_blocking_trains = 1, platform=1},
		is_ground_content = false,
		sounds = ndef.sounds,
		drawtype = "nodebox",
		node_box = {
@@ -33,6 +34,7 @@ function advtrains.register_platform(modprefix, preset)
		description = attrans("@1 Platform (high)", desc),
		tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex},
		groups = {cracky = 1, not_blocking_trains = 1, platform=2},
		is_ground_content = false,
		sounds = ndef.sounds,
		drawtype = "nodebox",
		node_box = {
@@ -58,6 +60,7 @@ function advtrains.register_platform(modprefix, preset)
	minetest.register_node(modprefix..":platform_45_"..nodename, {
		description = attrans("@1 Platform (45 degree)", desc),
		groups = {cracky = 1, not_blocking_trains = 1, platform=2},
		is_ground_content = false,
		sounds = ndef.sounds,
		drawtype = "mesh",
		mesh = "advtrains_platform_diag.b3d",
@@ -80,6 +83,7 @@ function advtrains.register_platform(modprefix, preset)
	minetest.register_node(modprefix..":platform_45_low_"..nodename, {
		description = attrans("@1 Platform (low, 45 degree)", desc),
		groups = {cracky = 1, not_blocking_trains = 1, platform=2},
		is_ground_content = false,
		sounds = ndef.sounds,
		drawtype = "mesh",
		mesh = "advtrains_platform_diag_low.b3d",
diff --git a/advtrains/signals.lua b/advtrains/signals.lua
index b26c950..bb581aa 100644
--- a/advtrains/signals.lua
+++ b/advtrains/signals.lua
@@ -46,7 +46,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
	for rotid, rotation in ipairs({"", "_30", "_45", "_60"}) do
		local crea=1
		if rotid==1 and r=="off" then crea=0 end
		

		minetest.register_node("advtrains:retrosignal_"..r..rotation, {
			drawtype = "mesh",
			paramtype="light",
@@ -69,6 +69,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
				save_in_at_nodedb=1,
				advtrains_signal = 2,
			},
			is_ground_content = false,
			mesecons = {effector = {
				rules=advtrains.meseconrules,
				["action_"..f.as] = function (pos, node)
@@ -110,7 +111,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
			after_dig_node = after_dig_func,
		})
		advtrains.trackplacer.add_worked("advtrains:retrosignal", r, rotation, nil)
		

		minetest.register_node("advtrains:signal_"..r..rotation, {
			drawtype = "mesh",
			paramtype="light",
@@ -132,6 +133,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
				save_in_at_nodedb=1,
				advtrains_signal = 2,
			},
			is_ground_content = false,
			light_source = 1,
			sunlight_propagates=true,
			mesecons = {effector = {
@@ -182,10 +184,10 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
		})
		advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil)
	end
	

	local crea=1
	if r=="off" then crea=0 end
	

	--tunnel signals. no rotations.
	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:signal_wall_"..loc.."_"..r, {
@@ -208,6 +210,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
				save_in_at_nodedb=1,
				advtrains_signal = 2,
			},
			is_ground_content = false,
			light_source = 1,
			sunlight_propagates=true,
			mesecons = {effector = {
@@ -280,6 +283,7 @@ minetest.register_node("advtrains:across_off", {
		save_in_at_nodedb=1,
		not_in_creative_inventory=nil,
	},
	is_ground_content = false,
	light_source = 1,
	sunlight_propagates=true,
	mesecons = {effector = {
@@ -321,6 +325,7 @@ minetest.register_node("advtrains:across_on", {
		save_in_at_nodedb=1,
		not_in_creative_inventory=1,
	},
	is_ground_content = false,
	light_source = 1,
	sunlight_propagates=true,
	mesecons = {effector = {
diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua
index 3959232..912b727 100644
--- a/advtrains/tracks.lua
+++ b/advtrains/tracks.lua
@@ -454,10 +454,10 @@ end
function advtrains.register_tracks(tracktype, def, preset)
	advtrains.trackplacer.register_tracktype(def.nodename_prefix, preset.tpdefault)
	if preset.regtp then
		advtrains.trackplacer.register_track_placer(def.nodename_prefix, def.texture_prefix, def.description, def)			
		advtrains.trackplacer.register_track_placer(def.nodename_prefix, def.texture_prefix, def.description, def)
	end
	if preset.regsp then
		advtrains.slope.register_placer(def, preset)			
		advtrains.slope.register_placer(def, preset)
	end
	for suffix, var in pairs(preset.variant) do
		for rotid, rotation in ipairs(preset.rotation) do
@@ -474,10 +474,10 @@ function advtrains.register_tracks(tracktype, def, preset)
						type = "fixed",
						fixed = {-1/2-1/16, -1/2, -1/2, 1/2+1/16, -1/2+2/16, 1/2},
					},
					

					mesh = def.shared_model or (def.models_prefix.."_"..img_suffix..def.models_suffix),
					tiles = {def.shared_texture or (def.texture_prefix.."_"..img_suffix..".png"), def.second_texture},
					

					groups = {
						attached_node = advtrains.IGNORE_WORLD and 0 or 1,
						advtrains_track=1,
@@ -487,7 +487,9 @@ function advtrains.register_tracks(tracktype, def, preset)
						not_in_creative_inventory=1,
						not_blocking_trains=1,
					},
						
					
					is_ground_content = false,

					can_dig = can_dig_callback,
					after_dig_node=function(pos)
						advtrains.ndb.update(pos)
@@ -500,19 +502,19 @@ function advtrains.register_tracks(tracktype, def, preset)
					at_rotation = rotation,
					at_rail_y = var.rail_y
				}, def.common or {})
				

				if preset.regtp then
					ndef.drop = def.nodename_prefix.."_placer"
				end
				if preset.regsp and var.slope then
					ndef.drop = def.nodename_prefix.."_slopeplacer"
				end
				

				--connections
				ndef.at_conns = advtrains.rotate_conn_by(var.conns, (rotid-1)*preset.regstep)
				

				local ndef_avt_table
				

				if var.switchalt and var.switchst then
					local switchfunc=function(pos, node, newstate)
						newstate = newstate or var.switchalt -- support for 3 (or more) state switches
@@ -531,7 +533,7 @@ function advtrains.register_tracks(tracktype, def, preset)
					end
					if var.switchmc then
						ndef.mesecons = {effector = {
							["action_"..var.switchmc] = function(pos, node) 
							["action_"..var.switchmc] = function(pos, node)
								advtrains.setstate(pos, nil, node)
							end,
							rules=advtrains.meseconrules
@@ -542,13 +544,13 @@ function advtrains.register_tracks(tracktype, def, preset)
						setstate = switchfunc,
					}
				end
				

				local adef={}
				if def.get_additional_definiton then
					adef=def.get_additional_definiton(def, preset, suffix, rotation)
				end
				ndef = advtrains.merge_tables(ndef, adef)
				

				-- insert getstate/setstate functions after merging the additional definitions
				if ndef_avt_table then
					ndef.advtrains = advtrains.merge_tables(ndef.advtrains or {}, ndef_avt_table)
@@ -580,7 +582,7 @@ function advtrains.is_track_and_drives_on(nodename, drives_on_p)
		hasentry=true
	end
	if not hasentry then drives_on = advtrains.all_tracktypes end
	

	if not minetest.registered_nodes[nodename] then
		return false
	end
@@ -599,7 +601,7 @@ function advtrains.get_track_connections(name, param2)
	local noderot=param2
	if not param2 then noderot=0 end
	if noderot > 3 then atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end
	

	local tracktype
	for k,_ in pairs(nodedef.groups) do
		local tt=string.match(k, "^advtrains_track_(.+)$")
@@ -645,12 +647,12 @@ end
--(itemstack, placer, pointed_thing)
function sl.create_slopeplacer_on_place(def, preset)
	return function(istack, player, pt)
		if not pt.type=="node" then 
		if not pt.type=="node" then
			minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node"))
			return istack 
			return istack
		end
		local pos=pt.above
		if not pos then 
		if not pos then
			minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node"))
			return istack
		end
@@ -659,14 +661,14 @@ function sl.create_slopeplacer_on_place(def, preset)
			minetest.chat_send_player(player:get_player_name(), attrans("Can't place: space occupied!"))
			return istack
		end
		if not advtrains.check_track_protection(pos, player:get_player_name()) then 
		if not advtrains.check_track_protection(pos, player:get_player_name()) then
			minetest.record_protection_violation(pos, player:get_player_name())
			return istack
		end
		--determine player orientation (only horizontal component)
		--get_look_horizontal may not be available
		local yaw=player.get_look_horizontal and player:get_look_horizontal() or (player:get_look_yaw() - math.pi/2)
		

		--rounding unit vectors is a nice way for selecting 1 of 8 directions since sin(30°) is 0.5.
		local dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)}
		--translate to direction to look up inside the preset table
@@ -688,13 +690,13 @@ function sl.create_slopeplacer_on_place(def, preset)
		})[dirvec.x][dirvec.z], dirvec.x~=0 and dirvec.z~=0
		local lookup=preset.slopeplacer
		if rot45 then lookup=preset.slopeplacer_45 end
		

		--go unitvector forward and look how far the next node is
		local step=1
		while step<=lookup.max do
			local node=minetest.get_node(vector.add(pos, dirvec))
			--next node solid?
			if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or advtrains.is_protected(pos, player:get_player_name()) then 
			if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or advtrains.is_protected(pos, player:get_player_name()) then
				--do slopes of this distance exist?
				if lookup[step] then
					if minetest.settings:get_bool("creative_mode") or istack:get_count()>=step then
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index 22aa6cf..910bc62 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -178,22 +178,22 @@ Value	Disp	Control	Meaning
function advtrains.hud_train_format(train, flip)
	if not train then return "","" end
	local sformat = string.format -- this appears to be faster than (...):format
	

	local max = train.max_speed or 10
	local res = train.speed_restriction
	local vel = advtrains.abs_ceil(train.velocity)
	local vel_kmh=advtrains.abs_ceil(advtrains.ms_to_kmh(train.velocity))
	

	local tlev=train.lever or 1
	if train.velocity==0 and not train.active_control then tlev=1 end
	if train.hud_lzb_effect_tmr then
		tlev=1
	end
	

	local ht = {"[combine:440x110:0,0=(advtrains_hud_bg.png^[resize\\:440x110)"}
	local st = {}
	if train.debug then st = {train.debug} end
	

	-- seven-segment display
	local function sevenseg(digit, x, y, w, h, m)
		--[[
@@ -231,7 +231,7 @@ function advtrains.hud_train_format(train, flip)
			end
		end
	end
	

	-- lever
	ht[#ht+1] = "275,10=(advtrains_hud_bg.png^[colorize\\:cyan^[resize\\:5x18)"
	ht[#ht+1] = "275,28=(advtrains_hud_bg.png^[colorize\\:white^[resize\\:5x18)"
@@ -288,7 +288,7 @@ function advtrains.hud_train_format(train, flip)
				ht[#ht+1] = sformat("130,10=(advtrains_hud_bg.png^[resize\\:30x5^[colorize\\:%s)",c)
				ht[#ht+1] = sformat("130,35=(advtrains_hud_bg.png^[resize\\:30x5^[colorize\\:%s)",c)
				if spd and spd~=0 then
					ht[#ht+1] = sformat("%d,50=(advtrains_hud_arrow.png^[multiply\\:red^[makealpha\\:#000000)", 1+spd*11) 
					ht[#ht+1] = sformat("%d,50=(advtrains_hud_arrow.png^[multiply\\:red^[makealpha\\:#000000)", 1+spd*11)
				end
				local floor = math.floor
				local dist = floor(((oc[i].index or train.index)-train.index))
@@ -300,15 +300,15 @@ function advtrains.hud_train_format(train, flip)
			end
		end
	end
	

	if res and res == 0 then
		st[#st+1] = attrans("OVERRUN RED SIGNAL! Examine situation and reverse train to move again.")
	end
	

	if train.atc_command then
			st[#st+1] = sformat("ATC: %s%s", train.atc_delay and advtrains.abs_ceil(train.atc_delay).."s " or "", train.atc_command or "")
	end
	

	return table.concat(st,"\n"), table.concat(ht,":")
end

@@ -321,6 +321,7 @@ local _, texture = advtrains.hud_train_format { -- dummy train object to demonst
minetest.register_node("advtrains:hud_demo",{
	description = "Train HUD demonstration",
	tiles = {texture},
	is_ground_content = false,
	groups = {cracky = 3, not_in_creative_inventory = 1}
})

diff --git a/advtrains_interlocking/demosignals.lua b/advtrains_interlocking/demosignals.lua
index 1c1b8b2..9484c53 100644
--- a/advtrains_interlocking/demosignals.lua
+++ b/advtrains_interlocking/demosignals.lua
@@ -41,6 +41,7 @@ minetest.register_node("advtrains_interlocking:ds_danger", {
		advtrains_signal = 2,
		save_in_at_nodedb = 1,
	},
	is_ground_content = false,
	advtrains = {
		set_aspect = setaspect,
		supported_aspects = suppasp,
@@ -60,6 +61,7 @@ minetest.register_node("advtrains_interlocking:ds_free", {
		advtrains_signal = 2,
		save_in_at_nodedb = 1,
	},
	is_ground_content = false,
	advtrains = {
		set_aspect = setaspect,
		supported_aspects = suppasp,
@@ -81,6 +83,7 @@ minetest.register_node("advtrains_interlocking:ds_slow", {
		advtrains_signal = 2,
		save_in_at_nodedb = 1,
	},
	is_ground_content = false,
	advtrains = {
		set_aspect = setaspect,
		supported_aspects = suppasp,
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index 0cc10da..cba1e25 100755
--- a/advtrains_interlocking/tcb_ts_ui.lua
+++ b/advtrains_interlocking/tcb_ts_ui.lua
@@ -34,6 +34,7 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
		--save_in_at_nodedb=2,
		at_il_track_circuit_break = 1,
	},
	is_ground_content = false,
	after_place_node = function(pos, node, player)
		local meta = minetest.get_meta(pos)
		meta:set_string("infotext", "Unconfigured Track Circuit Break, right-click to assign.")
@@ -44,7 +45,7 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
			minetest.chat_send_player(pname, "Insufficient privileges to use this!")
			return
		end
		

		local meta = minetest.get_meta(pos)
		local tcbpts = meta:get_string("tcb_pos")
		if tcbpts ~= "" then
@@ -58,9 +59,9 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
		else
			--unconfigured
			minetest.chat_send_player(pname, "Configuring TCB: Please punch the rail you want to assign this TCB to.")
			

			players_assign_tcb[pname] = pos
		end	
		end
	end,
	--on_punch = function(pos, node, player)
	--	local meta = minetest.get_meta(pos)
@@ -68,7 +69,7 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
	--	if tcbpts ~= "" then
	--		local tcbpos = minetest.string_to_pos(tcbpts)
	--		advtrains.interlocking.show_tcb_marker(tcbpos)
	--	end	
	--	end
	--end,
	can_dig = function(pos, player)
		if player == nil then return false end
@@ -83,7 +84,7 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
			if not minetest.check_player_privs(pname, "interlocking") then
				minetest.chat_send_player(pname, "Insufficient privileges to use this!")
				return
			end			
			end
			local tcbpos = minetest.string_to_pos(tcbpts)
			local tcb = ildb.get_tcb(tcbpos)
			if not tcb then return true end
@@ -97,7 +98,7 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
					return false
				end
			end
		end	
		end
		return true
	end,
	after_dig_node = function(pos, oldnode, oldmetadata, player)
@@ -168,14 +169,14 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
			local node_ok, conns, rhe = advtrains.get_rail_info_at(pos, advtrains.all_tracktypes)
			if node_ok and #conns == 2 then
				local ok = ildb.create_tcb(pos)
				

				if not ok then
					minetest.chat_send_player(pname, "Configuring TCB: TCB already exists at this position! It has now been re-assigned.")
				end
				

				ildb.sync_tcb_neighbors(pos, 1)
				ildb.sync_tcb_neighbors(pos, 2)
				

				local meta = minetest.get_meta(tcbnpos)
				meta:set_string("tcb_pos", minetest.pos_to_string(pos))
				meta:set_string("infotext", "TCB assigned to "..minetest.pos_to_string(pos))
@@ -188,7 +189,7 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
		end
		players_assign_tcb[pname] = nil
	end
	

	-- Signal assignment
	local sigd = players_assign_signal[pname]
	if sigd then
@@ -248,11 +249,11 @@ local function mktcbformspec(tcbs, btnpref, offset, pname)
		--if tcbs.section_free then
			--form = form.."button[0.5,"..(offset+1.5)..";5,1;"..btnpref.."_setlocked;Section is free]"
		--else
			--form = form.."button[0.5,"..(offset+1.5)..";5,1;"..btnpref.."_setfree;Section is blocked]"		
			--form = form.."button[0.5,"..(offset+1.5)..";5,1;"..btnpref.."_setfree;Section is blocked]"
		--end
	end
	if tcbs.signal then
		form = form.."button[0.5,"..(offset+2.5)..";5,1;"..btnpref.."_sigdia;Signalling]"	
		form = form.."button[0.5,"..(offset+2.5)..";5,1;"..btnpref.."_sigdia;Signalling]"
	else
		form = form.."button[0.5,"..(offset+2.5)..";5,1;"..btnpref.."_asnsig;Assign a signal]"
	end
@@ -267,11 +268,11 @@ function advtrains.interlocking.show_tcb_form(pos, pname)
	end
	local tcb = ildb.get_tcb(pos)
	if not tcb then return end
	

	local form = "size[6,9] label[0.5,0.5;Track Circuit Break Configuration]"
	form = form .. mktcbformspec(tcb[1], "A", 1, pname)
	form = form .. mktcbformspec(tcb[2], "B", 5, pname)
	

	minetest.show_formspec(pname, "at_il_tcbconfig_"..minetest.pos_to_string(pos), form)
	advtrains.interlocking.show_tcb_marker(pos)
end
@@ -304,7 +305,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
		local f_setfree = {fields.A_setfree, fields.B_setfree}
		local f_asnsig = {fields.A_asnsig, fields.B_asnsig}
		local f_sigdia = {fields.A_sigdia, fields.B_sigdia}
		

		for connid=1,2 do
			local tcbs = tcb[connid]
			if tcbs.ts_id then
@@ -367,22 +368,22 @@ function advtrains.interlocking.show_ts_form(ts_id, pname, sel_tcb)
	end
	local ts = ildb.get_ts(ts_id)
	if not ts_id then return end
	

	local form = "size[10,10]label[0.5,0.5;Track Section Detail - "..ts_id.."]"
	form = form.."field[0.8,2;5.2,1;name;Section name;"..minetest.formspec_escape(ts.name).."]"
	form = form.."button[5.5,1.7;1,1;setname;Set]"
	local hint
	

	local strtab = {}
	for idx, sigd in ipairs(ts.tc_breaks) do
		strtab[#strtab+1] = minetest.formspec_escape(sigd_to_string(sigd))
		advtrains.interlocking.show_tcb_marker(sigd.p)
	end
	

	form = form.."textlist[0.5,3;5,3;tcblist;"..table.concat(strtab, ",").."]"
	

	if ildb.may_modify_ts(ts) then
		

		if players_link_ts[pname] then
			local other_id = players_link_ts[pname]
			local other_ts = ildb.get_ts(other_id)
@@ -405,7 +406,7 @@ function advtrains.interlocking.show_ts_form(ts_id, pname, sel_tcb)
	else
		hint=3
	end
	

	if ts.route then
		form = form.."label[0.5,6.1;Route is set: "..ts.route.rsn.."]"
	elseif ts.route_post then
@@ -418,9 +419,9 @@ function advtrains.interlocking.show_ts_form(ts_id, pname, sel_tcb)
	else
		form = form.."label[0.5,7.1;No trains on this section.]"
	end
	

	form = form.."button[5.5,7;4,1;reset;Reset section state]"
	

	if hint == 1 then
		form = form.."label[0.5,0.75;Use the 'Join' button to designate rail crosses and link not listed far-away TCBs]"
	elseif hint == 2 then
@@ -429,10 +430,10 @@ function advtrains.interlocking.show_ts_form(ts_id, pname, sel_tcb)
		form = form.."label[0.5,0.75;You cannot modify track sections when a route is set or a train is on the section.]"
		--form = form.."label[0.5,1;Trying to unlink a TCB directly connected to this track will not work.]"
	end
	

	ts_pselidx[pname]=sel_tcb
	minetest.show_formspec(pname, "at_il_tsconfig_"..ts_id, form)
	

end


@@ -444,12 +445,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
	-- independent of the formspec, clear this whenever some formspec event happens
	local tpsi = ts_pselidx[pname]
	ts_pselidx[pname] = nil
	

	local ts_id = string.match(formname, "^at_il_tsconfig_(.+)$")
	if ts_id and not fields.quit then
		local ts = ildb.get_ts(ts_id)
		if not ts then return end
		

		local sel_tcb
		if fields.tcblist then
			local tev = minetest.explode_textlist_event(fields.tcblist)
@@ -458,7 +459,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
		elseif tpsi then
			sel_tcb = tpsi
		end
		

		if ildb.may_modify_ts(ts) then
			if players_link_ts[pname] then
				if fields.cancellink then
@@ -468,14 +469,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
					players_link_ts[pname] = nil
				end
			end
			

			if fields.del_tcb and sel_tcb and sel_tcb > 0 and sel_tcb <= #ts.tc_breaks then
				if not ildb.remove_from_interlocking(ts.tc_breaks[sel_tcb]) then
					minetest.chat_send_player(pname, "Please unassign signal first!")
				end
				sel_tcb = nil
			end
			

			if fields.link then
				players_link_ts[pname] = ts_id
			end
@@ -485,14 +486,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
				return
			end
		end
		

		if fields.setname then
			ts.name = fields.name
			if ts.name == "" then
				ts.name = "Section "..ts_id
			end
		end
		

		if fields.reset then
			-- User requested resetting the section
			-- Show him what this means...
@@ -503,11 +504,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
			minetest.show_formspec(pname, "at_il_tsreset_"..ts_id, form)
			return
		end
		

		advtrains.interlocking.show_ts_form(ts_id, pname, sel_tcb)
		return
	end
	

	ts_id = string.match(formname, "^at_il_tsreset_(.+)$")
	if ts_id and fields.reset then
		local ts = ildb.get_ts(ts_id)
@@ -557,7 +558,7 @@ function advtrains.interlocking.show_tcb_marker(pos)
	local node_ok, conns, rhe = advtrains.get_rail_info_at(pos, advtrains.all_tracktypes)
	if not node_ok then return end
	local yaw = advtrains.conn_angle_median(conns[2].c, conns[1].c)
	

	local itex = {}
	for connid=1,2 do
		local tcbs = tcb[connid]
@@ -571,12 +572,12 @@ function advtrains.interlocking.show_tcb_marker(pos)
			itex[connid] = "--EOI--"
		end
	end
	

	local pts = advtrains.roundfloorpts(pos)
	if markerent[pts] then
		markerent[pts]:remove()
	end
	

	local obj = minetest.add_entity(pos, "advtrains_interlocking:tcbmarker")
	if not obj then return end
	obj:set_yaw(yaw)
@@ -585,7 +586,7 @@ function advtrains.interlocking.show_tcb_marker(pos)
	})
	local le = obj:get_luaentity()
	if le then le.tcbpos = pos end
	

	markerent[pts] = obj
end

@@ -603,15 +604,15 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle
	end
	local hasprivs = minetest.check_player_privs(pname, "interlocking")
	local tcbs = ildb.get_tcbs(sigd)
	

	if not tcbs.signal then return end
	if not tcbs.signal_name then tcbs.signal_name = "Signal at "..minetest.pos_to_string(sigd.p) end
	if not tcbs.routes then tcbs.routes = {} end
	

	local form = "size[7,10]label[0.5,0.5;Signal at "..minetest.pos_to_string(sigd.p).."]"
	form = form.."field[0.8,1.5;5.2,1;name;Signal name;"..minetest.formspec_escape(tcbs.signal_name).."]"
	form = form.."button[5.5,1.2;1,1;setname;Set]"
	

	if tcbs.routeset then
		local rte = tcbs.routes[tcbs.routeset]
		if not rte then
@@ -636,7 +637,7 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle
			form = form.."label[0.5,7.3;Route is re-set when a train passed.]"
			form = form.."button[0.5,7.7;  5,1;noauto;Disable Automatic Working]"
		end
		

		form = form.."button[0.5,6;  5,1;cancelroute;Cancel Route]"
	else
		if not tcbs.route_origin then
@@ -683,11 +684,11 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle
			form = form.."label[0.5,2.5;Route is set over this signal by:\n"..sigd_to_string(tcbs.route_origin).."]"
			form = form.."label[0.5,4;Wait for this route to be cancelled in order to do anything here.]"
		end
	end	
	end
	sig_pselidx[pname] = sel_rte
	minetest.show_formspec(pname, "at_il_signalling_"..minetest.pos_to_string(sigd.p).."_"..sigd.s, form)
	p_open_sig_form[pname] = sigd
	

	-- always a good idea to update the signal aspect
	if not called_from_form_update then
	-- FIX prevent a callback loop
@@ -710,12 +711,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
		return
	end
	local hasprivs = minetest.check_player_privs(pname, "interlocking")
	

	-- independent of the formspec, clear this whenever some formspec event happens
	local tpsi = sig_pselidx[pname]
	sig_pselidx[pname] = nil
	p_open_sig_form[pname] = nil
	

	local pts, connids = string.match(formname, "^at_il_signalling_([^_]+)_(%d)$")
	local pos, connid
	if pts then
@@ -775,7 +776,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
				end
			end
		end
		

		if fields.unassign and hasprivs then
			-- unassigning the signal from the tcbs
			-- only when no route is set.
@@ -796,26 +797,26 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
			advtrains.interlocking.show_ip_form(tcbs.signal, pname)
			return
		end
		

		if tcbs.ars_disabled and fields.arsenable then
			tcbs.ars_disabled = nil
		end
		if not tcbs.ars_disabled and fields.arsdisable then
			tcbs.ars_disabled = true
		end
		

		if fields.auto then
			tcbs.route_auto = true
		end
		if fields.noauto then
			tcbs.route_auto = false
		end
		

		advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, true)
		return
	end
	
	


	if not hasprivs then return end
	-- rename route
	local rind, rte_id
diff --git a/advtrains_luaautomation/operation_panel.lua b/advtrains_luaautomation/operation_panel.lua
index c118ff3..382b415 100755
--- a/advtrains_luaautomation/operation_panel.lua
+++ b/advtrains_luaautomation/operation_panel.lua
@@ -12,6 +12,7 @@ minetest.register_node("advtrains_luaautomation:oppanel", {
		cracky = 1,
		save_in_at_nodedb=1,
	},
	is_ground_content = false,
	after_place_node = atlatc.active.after_place_node,
	after_dig_node = atlatc.active.after_dig_node,
	on_receive_fields = atlatc.active.on_receive_fields,
diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua
index bdbd50d..2b84545 100755
--- a/advtrains_signals_ks/init.lua
+++ b/advtrains_signals_ks/init.lua
@@ -105,7 +105,7 @@ local suppasp_ra = {
		dst = { false },
		shunt = nil,
		proceed_as_main = false,
		

		info = {
			call_on = false,
			dead_end = false,
@@ -172,11 +172,11 @@ for _, rtab in ipairs({
			drawtype = "mesh",
			mesh = "advtrains_signals_ks_main_smr"..rot..".obj",
			tiles = {"advtrains_signals_ks_mast.png", "advtrains_signals_ks_head.png", "advtrains_signals_ks_head.png", tile},
			

			paramtype="light",
			sunlight_propagates=true,
			light_source = 4,
			

			paramtype2 = "facedir",
			selection_box = {
				type = "fixed",
@@ -189,6 +189,7 @@ for _, rtab in ipairs({
				save_in_at_nodedb = 1,
				not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1,
			},
			is_ground_content = false,
			drop = "advtrains_signals_ks:hs_danger_0",
			inventory_image = "advtrains_signals_ks_hs_inv.png",
			advtrains = {
@@ -203,8 +204,8 @@ for _, rtab in ipairs({
		-- rotatable by trackworker
		advtrains.trackplacer.add_worked("advtrains_signals_ks:hs", typ, "_"..rot)
	end
	
	


	--Rangiersignale:
	for typ, prts in pairs({
			danger = {asp = { main = false, shunt = false }, n = "shuntd", ici=true},
@@ -215,11 +216,11 @@ for _, rtab in ipairs({
			drawtype = "mesh",
			mesh = "advtrains_signals_ks_sht_smr"..rot..".obj",
			tiles = {"advtrains_signals_ks_mast.png", "advtrains_signals_ks_head.png", "advtrains_signals_ks_head.png", "advtrains_signals_ks_ltm_"..typ..".png"},
			

			paramtype="light",
			sunlight_propagates=true,
			light_source = 4,
			

			paramtype2 = "facedir",
			selection_box = {
				type = "fixed",
@@ -232,6 +233,7 @@ for _, rtab in ipairs({
				save_in_at_nodedb = 1,
				not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1,
			},
			is_ground_content = false,
			drop = "advtrains_signals_ks:ra_danger_0",
			inventory_image = "advtrains_signals_ks_ra_inv.png",
			advtrains = {
@@ -256,11 +258,11 @@ for _, rtab in ipairs({
			drawtype = "mesh",
			mesh = "advtrains_signals_ks_"..mesh.."_smr"..rot..".obj",
			tiles = {"advtrains_signals_ks_signpost.png", tile2},
			

			paramtype="light",
			sunlight_propagates=true,
			light_source = 4,
			

			paramtype2 = "facedir",
			selection_box = {
				type = "fixed",
@@ -273,6 +275,7 @@ for _, rtab in ipairs({
				save_in_at_nodedb = 1,
				not_in_creative_inventory = (rtab.ici and typ == dtyp) and 0 or 1,
			},
			is_ground_content = false,
			drop = "advtrains_signals_ks:"..prefix.."_"..dtyp.."_0",
			inventory_image = inv,
			advtrains = {
@@ -297,7 +300,7 @@ for _, rtab in ipairs({
		end
		register_sign("sign", typ, prts.n, "Signal Sign", "sign"..mesh, tile2, "hfs", "advtrains_signals_ks_sign_lf7.png", prts.asp)
	end
	

	for typ, prts in pairs {
		-- Speed restrictions:
		["4"] = {asp = { main = 4, shunt = true }, n = "6"},
@@ -341,7 +344,7 @@ for _, rtab in ipairs({
		local inv = "advtrains_signals_ks_sign_lf7.png^(advtrains_signals_ks_sign_8.png^[makealpha:255,255,255)"
		register_sign("sign_lf7", typ, prts.n, "Line speed restriction sign", "sign", tile2, "8", inv, {main = prts.main, shunt = true, type = "line"})
	end
	

	-- Geschwindigkeits(vor)anzeiger für Ks-Signale
	for typ, prts in pairs({
			["off"] = {n = "4", ici = true},
@@ -368,6 +371,7 @@ for _, rtab in ipairs({
				save_in_at_nodedb = 1,
				not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1,
			},
			is_ground_content = false,
			after_dig_node = function(pos) advtrains.ndb.update(pos) end
		}

@@ -389,17 +393,17 @@ for _, rtab in ipairs({
		minetest.register_node("advtrains_signals_ks:zs3v_"..typ.."_"..rot, t)
		advtrains.trackplacer.add_worked("advtrains_signals_ks:zs3v", typ, "_"..rot)
	end
	

	minetest.register_node("advtrains_signals_ks:mast_mast_"..rot, {
		description = "Ks Mast",
		drawtype = "mesh",
		mesh = "advtrains_signals_ks_mast_smr"..rot..".obj",
		tiles = {"advtrains_signals_ks_mast.png"},
		

		paramtype="light",
		sunlight_propagates=true,
		--light_source = 4,
		

		paramtype2 = "facedir",
		selection_box = {
			type = "fixed",
@@ -410,6 +414,7 @@ for _, rtab in ipairs({
			not_blocking_trains = 1,
			not_in_creative_inventory = (rtab.ici) and 0 or 1,
		},
		is_ground_content = false,
		drop = "advtrains_signals_ks:mast_mast_0",
	})
	advtrains.trackplacer.add_worked("advtrains_signals_ks:mast","mast", "_"..rot)
diff --git a/advtrains_signals_ks/init_degrotate_nodes.lua b/advtrains_signals_ks/init_degrotate_nodes.lua
index bd213cb..73e5d6d 100644
--- a/advtrains_signals_ks/init_degrotate_nodes.lua
+++ b/advtrains_signals_ks/init_degrotate_nodes.lua
@@ -27,6 +27,7 @@ minetest.register_node("advtrains_signals_ks:mast", {
		not_blocking_trains=1,
		--save_in_at_nodedb=2,
	},
	is_ground_content = false,
	after_place_node = place_degrotate,
})

@@ -48,6 +49,7 @@ minetest.register_node("advtrains_signals_ks:head_main", {
		not_blocking_trains=1,
		--save_in_at_nodedb=2,
	},
	is_ground_content = false,
	after_place_node = place_degrotate,
})

@@ -69,6 +71,7 @@ minetest.register_node("advtrains_signals_ks:zs_top", {
		not_blocking_trains=1,
		--save_in_at_nodedb=2,
	},
	is_ground_content = false,
	after_place_node = place_degrotate,
})

@@ -90,5 +93,6 @@ minetest.register_node("advtrains_signals_ks:zs_bottom", {
		not_blocking_trains=1,
		--save_in_at_nodedb=2,
	},
	is_ground_content = false,
	after_place_node = place_degrotate,
})
-- 
2.44.0