1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-09-22 03:40:18 +02:00

Carts: Fix the rail table overwrite behaviour

This commit is contained in:
SmallJoker 2017-02-12 11:47:22 +01:00 committed by Auke Kok
parent 0819d4bade
commit 89c45993ac

View File

@ -181,8 +181,8 @@ function carts:pathfinder(pos_, old_pos, old_dir, ctrl, pf_switch, railtype)
return false return false
end end
function carts:register_rail(name, def, railparams) function carts:register_rail(name, def_overwrite, railparams)
local def_default = { local def = {
drawtype = "raillike", drawtype = "raillike",
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
@ -194,7 +194,7 @@ function carts:register_rail(name, def, railparams)
}, },
sounds = default.node_sound_metal_defaults() sounds = default.node_sound_metal_defaults()
} }
for k, v in pairs(def_default) do for k, v in pairs(def_overwrite) do
def[k] = v def[k] = v
end end
if not def.inventory_image then if not def.inventory_image then