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,
|
||||
})
|
||||
|
||||
signs_bot.register_botcommand("punch_cart", {
|
||||
mod = "item",
|
||||
params = "",
|
||||
num_param = 0,
|
||||
description = S("Punch a rail cart to start it"),
|
||||
cmnd = function(base_pos, mem)
|
||||
local punch_dir = minetest.facedir_to_dir(mem.robot_param2)
|
||||
minecart.punch_cart(mem.robot_pos, mem.robot_param2, 1, punch_dir)
|
||||
return signs_bot.DONE
|
||||
end,
|
||||
})
|
||||
if minetest.global_exists("minecart") then
|
||||
signs_bot.register_botcommand("punch_cart", {
|
||||
mod = "item",
|
||||
params = "",
|
||||
num_param = 0,
|
||||
description = S("Punch a rail cart to start it"),
|
||||
cmnd = function(base_pos, mem)
|
||||
local punch_dir = minetest.facedir_to_dir(mem.robot_param2)
|
||||
minecart.punch_cart(mem.robot_pos, mem.robot_param2, 1, punch_dir)
|
||||
return signs_bot.DONE
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- 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.."/node_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.."/legacy.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({
|
||||
name = "sign_add_cart",
|
||||
description = S('Sign "add to cart"'),
|
||||
@ -273,7 +273,7 @@ if minetest.get_modpath("doc") then
|
||||
})
|
||||
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", {
|
||||
name = S('Sign "add to cart"'),
|
||||
data = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user