From 3d7924c751bc8ca438e4b9bd1cb1f241cc636494 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Tue, 29 May 2018 15:53:34 +0200 Subject: Fix bugs found while testing --- advtrains/init.lua | 2 +- advtrains/path.lua | 2 +- advtrains/tracks.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'advtrains') diff --git a/advtrains/init.lua b/advtrains/init.lua index 323d55a..587dd12 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -377,7 +377,7 @@ function advtrains.save(remove_players_from_wagons) end atprint("[save_all]Saved advtrains save files") end ---minetest.register_on_shutdown(advtrains.save) +minetest.register_on_shutdown(advtrains.save) -- This chat command provides a solution to the problem known on the LinuxWorks server -- There are many players that joined a single time, got on a train and then left forever diff --git a/advtrains/path.lua b/advtrains/path.lua index 8bdb72b..4a81ce9 100644 --- a/advtrains/path.lua +++ b/advtrains/path.lua @@ -54,7 +54,7 @@ function advtrains.path_create(train, pos, connid, rel_index) train.path_req_b=0 advtrains.occ.set_item(train.id, posr, 0) - + return true end -- Sets position and connid to properly restore after a crash, e.g. in order diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua index eefff66..559ada7 100644 --- a/advtrains/tracks.lua +++ b/advtrains/tracks.lua @@ -304,7 +304,7 @@ function advtrains.register_tracks(tracktype, def, preset) if var.switchalt and var.switchst then local switchfunc=function(pos, node, newstate) - if newstate~=var.switchst then + if newstate~=var.switchst and not advtrains.get_train_at_pos(pos) then advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..var.switchalt..rotation, param2=node.param2}) advtrains.invalidate_all_paths(pos) end -- cgit v1.2.3