Added mechanism to avoid double-detection
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Thu, 22 Dec 2016 11:54:02 +0000 (12:54 +0100)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Thu, 22 Dec 2016 11:54:02 +0000 (12:54 +0100)
tracks.lua

index 0b7d125..ffca506 100644 (file)
@@ -600,7 +600,8 @@ advtrains.register_tracks("default", {
                                           local endsp = train.tarvelocity;\r
                                           train.tarvelocity = 0;\r
                                           train.velocity = 0;\r
-                                          minetest.after(10,function(t,sp)     train.movedir = -train.movedir; t.tarvelocity=sp; end, train, endsp);\r
+                                          minetest.swap_node(pos, {name="advtrains:dtrack".."_"..suffix..rotation, param2=minetest.get_node(pos).param2})\r
+                                          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);\r
                                        end\r
                                }\r
                        }\r