aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-05-29 15:53:34 +0200
committerorwell96 <orwell@bleipb.de>2018-06-14 17:39:42 +0200
commit3d7924c751bc8ca438e4b9bd1cb1f241cc636494 (patch)
treef389bb158500b7bdb03d792f7f1a80bd8a5de18b /advtrains
parent521112aced4e06f8fb59c9dfe8d0e082da858eb1 (diff)
downloadadvtrains-3d7924c751bc8ca438e4b9bd1cb1f241cc636494.tar.gz
advtrains-3d7924c751bc8ca438e4b9bd1cb1f241cc636494.tar.bz2
advtrains-3d7924c751bc8ca438e4b9bd1cb1f241cc636494.zip
Fix bugs found while testing
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/init.lua2
-rw-r--r--advtrains/path.lua2
-rw-r--r--advtrains/tracks.lua2
3 files changed, 3 insertions, 3 deletions
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