aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-12-22 12:54:02 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-12-22 12:54:02 +0100
commitb4b4936b15127b48f527eccdcee0a5de82a2a2fb (patch)
treecb443225fc5d6d9d7d8222b39ee0f29ce1096be1
parent7a1c4990d9bc9e7eaed980425a628afb500d6d6e (diff)
downloadadvtrains-b4b4936b15127b48f527eccdcee0a5de82a2a2fb.tar.gz
advtrains-b4b4936b15127b48f527eccdcee0a5de82a2a2fb.tar.bz2
advtrains-b4b4936b15127b48f527eccdcee0a5de82a2a2fb.zip
Added mechanism to avoid double-detection
-rw-r--r--tracks.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/tracks.lua b/tracks.lua
index 0b7d125..ffca506 100644
--- a/tracks.lua
+++ b/tracks.lua
@@ -600,7 +600,8 @@ advtrains.register_tracks("default", {
local endsp = train.tarvelocity;
train.tarvelocity = 0;
train.velocity = 0;
- minetest.after(10,function(t,sp) train.movedir = -train.movedir; t.tarvelocity=sp; end, train, endsp);
+ minetest.swap_node(pos, {name="advtrains:dtrack".."_"..suffix..rotation, param2=minetest.get_node(pos).param2})
+ minetest.after(10,function(t,sp,pos) train.movedir = -train.movedir; t.tarvelocity=sp; minetest.swap_node(pos, {name="advtrains:dtrack_stop".."_"..suffix..rotation, param2=minetest.get_node(pos).param2}); end, train, endsp,pos);
end
}
}