mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-09 08:39:34 +01:00
Fix detector rail strangeness, prevent crash
This commit is contained in:
parent
524fe37f4a
commit
fcbb4f6e34
2 changed files with 5 additions and 13 deletions
|
@ -276,7 +276,7 @@ local function calculate_acceleration(staticdata)
|
|||
|
||||
if (ctrl.forward or 0) > time_active then
|
||||
if staticdata.velocity == 0 then
|
||||
local look_dir = look_directions[ctrl.look or 0]
|
||||
local look_dir = look_directions[ctrl.look or 0] or mod.north
|
||||
local dot = vector.dot(staticdata.dir, look_dir)
|
||||
if dot < 0 then
|
||||
reverse_direction(staticdata)
|
||||
|
|
|
@ -19,12 +19,8 @@ mod.register_straight_rail("mcl_minecarts:detector_rail_v2",{"mcl_minecarts_rail
|
|||
},
|
||||
_mcl_minecarts_on_enter = function(pos, cart)
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
local newnode = {
|
||||
name = "mcl_minecarts:detector_rail_v2_on",
|
||||
param2 = node.param2
|
||||
}
|
||||
minetest.swap_node( pos, newnode )
|
||||
node.name = "mcl_minecarts:detector_rail_v2_on"
|
||||
minetest.set_node( pos, node )
|
||||
mesecon.receptor_on(pos)
|
||||
end,
|
||||
craft = {
|
||||
|
@ -51,12 +47,8 @@ mod.register_straight_rail("mcl_minecarts:detector_rail_v2_on",{"mcl_minecarts_r
|
|||
},
|
||||
_mcl_minecarts_on_leave = function(pos, cart)
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
local newnode = {
|
||||
name = "mcl_minecarts:detector_rail",
|
||||
param2 = node.param2
|
||||
}
|
||||
minetest.swap_node( pos, newnode )
|
||||
node.name = "mcl_minecarts:detector_rail_v2"
|
||||
minetest.set_node( pos, node )
|
||||
mesecon.receptor_off(pos)
|
||||
end,
|
||||
drop = "mcl_minecarts:detector_rail_v2",
|
||||
|
|
Loading…
Reference in a new issue