mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-08-22 09:57:25 +02:00
Fix typo in rail replacement mapping, fix several crashes
This commit is contained in:
parent
c04ed709e0
commit
581dcd7b3f
@ -154,8 +154,8 @@ local function handle_cart_collision(cart1_staticdata, prev_pos, next_dir)
|
||||
local m2 = cart2_staticdata.mass
|
||||
|
||||
--print("u1="..tostring(u1)..",u2="..tostring(u2))
|
||||
if u2 == 0 and u1 < 4 and train_length(cart1) < MAX_TRAIN_LENGTH then
|
||||
link_cart_ahead(cart1, {_staticdata=cart2_staticdata})
|
||||
if u2 == 0 and u1 < 4 and train_length(cart1_staticdata) < MAX_TRAIN_LENGTH then
|
||||
link_cart_ahead(cart1_staticdata, cart2_staticdata)
|
||||
cart2_staticdata.dir = mcl_minecarts:get_rail_direction(cart2_staticdata.connected_at, cart1_staticdata.dir)
|
||||
cart2_staticdata.velocity = cart1_staticdata.velocity
|
||||
return
|
||||
@ -268,7 +268,7 @@ end
|
||||
|
||||
local function reverse_direction(staticdata)
|
||||
if staticdata.behind or staticdata.ahead then
|
||||
reverse_train(self)
|
||||
reverse_train(staticdata)
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -636,7 +636,7 @@ minetest.register_lbm({
|
||||
local STRAIGHT_RAILS_MAP ={
|
||||
["mcl_minecarts:golden_rail"] = "mcl_minecarts:golden_rail_v2",
|
||||
["mcl_minecarts:golden_rail_on"] = "mcl_minecarts:golden_rail_v2_on",
|
||||
["mcl_minecarts:activator_rail"] = "mcl_minecarts_activator_rail_v2",
|
||||
["mcl_minecarts:activator_rail"] = "mcl_minecarts:activator_rail_v2",
|
||||
["mcl_minecarts:activator_rail_on"] = "mcl_minecarts:activator_rail_v2_on",
|
||||
["mcl_minecarts:detector_rail"] = "mcl_minecarts:detector_rail_v2",
|
||||
["mcl_minecarts:detector_rail_on"] = "mcl_minecarts:detector_rail_v2_on",
|
||||
|
@ -139,10 +139,7 @@ function mod.update_train(staticdata)
|
||||
end
|
||||
end
|
||||
|
||||
function mod.link_cart_ahead(cart, cart_ahead)
|
||||
local staticdata = cart._staticdata
|
||||
local ca_staticdata = cart_ahead._staticdata
|
||||
|
||||
function mod.link_cart_ahead(staticdata, ca_staticdata)
|
||||
minetest.log("action","Linking cart #"..staticdata.uuid.." to cart #"..ca_staticdata.uuid)
|
||||
|
||||
staticdata.ahead = ca_staticdata.uuid
|
||||
|
Loading…
Reference in New Issue
Block a user