Fix bug #15 (Error when enter in game)
This commit is contained in:
parent
64366ee411
commit
13e56c7f16
24
cmd_item.lua
24
cmd_item.lua
@ -239,17 +239,19 @@ signs_bot.register_botcommand("drop_items", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_bot.register_botcommand("punch_cart", {
|
if minetest.global_exists("minecart") then
|
||||||
mod = "item",
|
signs_bot.register_botcommand("punch_cart", {
|
||||||
params = "",
|
mod = "item",
|
||||||
num_param = 0,
|
params = "",
|
||||||
description = S("Punch a rail cart to start it"),
|
num_param = 0,
|
||||||
cmnd = function(base_pos, mem)
|
description = S("Punch a rail cart to start it"),
|
||||||
local punch_dir = minetest.facedir_to_dir(mem.robot_param2)
|
cmnd = function(base_pos, mem)
|
||||||
minecart.punch_cart(mem.robot_pos, mem.robot_param2, 1, punch_dir)
|
local punch_dir = minetest.facedir_to_dir(mem.robot_param2)
|
||||||
return signs_bot.DONE
|
minecart.punch_cart(mem.robot_pos, mem.robot_param2, 1, punch_dir)
|
||||||
end,
|
return signs_bot.DONE
|
||||||
})
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- def is a table with following data:
|
-- def is a table with following data:
|
||||||
-- {
|
-- {
|
||||||
|
4
init.lua
4
init.lua
@ -65,7 +65,9 @@ dofile(MP.."/nodes.lua")
|
|||||||
dofile(MP.."/bot_sensor.lua")
|
dofile(MP.."/bot_sensor.lua")
|
||||||
dofile(MP.."/node_sensor.lua")
|
dofile(MP.."/node_sensor.lua")
|
||||||
dofile(MP.."/crop_sensor.lua")
|
dofile(MP.."/crop_sensor.lua")
|
||||||
dofile(MP.."/cart_sensor.lua")
|
if minetest.global_exists("minecart") then
|
||||||
|
dofile(MP.."/cart_sensor.lua")
|
||||||
|
end
|
||||||
dofile(MP.."/chest.lua")
|
dofile(MP.."/chest.lua")
|
||||||
dofile(MP.."/legacy.lua")
|
dofile(MP.."/legacy.lua")
|
||||||
dofile(MP.."/techage.lua")
|
dofile(MP.."/techage.lua")
|
||||||
|
@ -195,7 +195,7 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if minetest.get_modpath("minecart") then
|
if minetest.global_exists("minecart") then
|
||||||
register_sign({
|
register_sign({
|
||||||
name = "sign_add_cart",
|
name = "sign_add_cart",
|
||||||
description = S('Sign "add to cart"'),
|
description = S('Sign "add to cart"'),
|
||||||
@ -273,7 +273,7 @@ if minetest.get_modpath("doc") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("doc") and minetest.get_modpath("minecart") then
|
if minetest.get_modpath("doc") and minetest.global_exists("minecart") then
|
||||||
doc.add_entry("signs_bot", "sign_add_cart", {
|
doc.add_entry("signs_bot", "sign_add_cart", {
|
||||||
name = S('Sign "add to cart"'),
|
name = S('Sign "add to cart"'),
|
||||||
data = {
|
data = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user