Fix broken cart recheck, place carts:rail instead

This adds a hard depencency on the carts mod
master
Wuzzy 2017-08-14 21:02:51 +02:00
parent d20c3bee46
commit 7957c52cd6
3 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
default
carts
tnt
farming
carts?
treasurer?
mobs_monster?

View File

@ -5,7 +5,7 @@
tsm_railcorridors.nodes = {
dirt = "default:dirt",
chest = "default:chest",
rail = "default:rail",
rail = "carts:rail",
torch_floor = "default:torch",
torch_wall = "default:torch_wall",

View File

@ -316,6 +316,7 @@ local function RecheckCartHack(params)
if minetest.get_node(pos).name == tsm_railcorridors.nodes.rail then
minetest.add_entity(pos, cart_id)
minetest.after(5, RecheckCartHack, {pos, cart_id, tries})
return
end
-- The rail may have been destroyed in the meantime, that's why the node is checked.
end
@ -625,7 +626,7 @@ local function corridor_func(waypoint, coord, sign, up_or_down, up_or_down_next,
-- Note that the callback function is also called there.
-- TODO: Move callback function to this position when the
-- minetest.add_entity bug has been fixed.
minetest.after(2, RecheckCartHack, {cpos, cart_id, 10})
minetest.after(3, RecheckCartHack, {cpos, cart_id, 12})
end
end
end