From baa50c03920fd0a563fce09929f3d56c3374e8bd Mon Sep 17 00:00:00 2001 From: orwell Date: Sat, 20 Jul 2024 18:02:33 +0200 Subject: ARS supports triggering distant signal, other bugfixes --- advtrains/lzb.lua | 2 +- advtrains/path.lua | 2 +- advtrains/trackplacer.lua | 8 ++++---- advtrains/trainlogic.lua | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'advtrains') diff --git a/advtrains/lzb.lua b/advtrains/lzb.lua index 64e4553..52c2289 100644 --- a/advtrains/lzb.lua +++ b/advtrains/lzb.lua @@ -48,7 +48,7 @@ local params = { ZONE_HOLD = 5, -- added on top of ZONE_ROLL 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, } diff --git a/advtrains/path.lua b/advtrains/path.lua index 28df529..d54aebe 100644 --- a/advtrains/path.lua +++ b/advtrains/path.lua @@ -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) local origin_conn = train.path_ori_cp[advtrains.encode_pos(adj_pos)] 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 end end diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua index e6111dc..597e8ec 100644 --- a/advtrains/trackplacer.lua +++ b/advtrains/trackplacer.lua @@ -288,8 +288,8 @@ minetest.register_craftitem("advtrains:trackworker",{ advtrains.ndb.swap_node(pos, new_node) end end, - on_use=function(itemstack, user, pointed_thing) - local name = user:get_player_name() + on_use=function(itemstack, player, pointed_thing) + local name = player:get_player_name() if not name then return end @@ -305,7 +305,7 @@ minetest.register_craftitem("advtrains:trackworker",{ local ndef = minetest.registered_nodes[node.name] 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 end @@ -318,7 +318,7 @@ minetest.register_craftitem("advtrains:trackworker",{ if reason then str = str .. " " .. reason end - minetest.chat_send_player(placer:get_player_name(), str) + minetest.chat_send_player(name, str) return end end diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index cb1f9a6..9e9f214 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -865,7 +865,7 @@ local function tnc_call_enter_callback(pos, train_id, train, index) -- check for split points 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 - 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] 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 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 - 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 end end @@ -1188,7 +1188,7 @@ function advtrains.invert_train(train_id) local pos = advtrains.path_get(train, index) local ok, conns, railheight, connmap = advtrains.get_rail_info_at(pos) 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] end end -- cgit v1.2.3