2014-07-22 23:15:43 +02:00
|
|
|
|
|
|
|
boost_cart = {}
|
|
|
|
boost_cart.modpath = minetest.get_modpath("boost_cart")
|
2016-04-15 09:45:26 +02:00
|
|
|
|
|
|
|
-- Maximal speed of the cart in m/s
|
2015-01-11 11:57:49 +01:00
|
|
|
boost_cart.speed_max = 10
|
2016-10-12 17:22:49 +02:00
|
|
|
-- Set to -1 to disable punching the cart from inside
|
|
|
|
boost_cart.punch_speed_max = 7
|
2016-04-15 09:45:26 +02:00
|
|
|
|
2014-07-29 12:51:57 +02:00
|
|
|
|
2015-11-13 23:11:08 +01:00
|
|
|
if not boost_cart.modpath then
|
|
|
|
error("\nWrong mod directory name! Please change it to 'boost_cart'.\n" ..
|
|
|
|
"See also: http://dev.minetest.net/Installing_Mods")
|
|
|
|
end
|
|
|
|
|
2015-06-05 20:30:48 +02:00
|
|
|
-- Support for non-default games
|
|
|
|
if not default.player_attached then
|
|
|
|
default.player_attached = {}
|
|
|
|
end
|
|
|
|
|
2016-11-22 20:32:17 +01:00
|
|
|
dofile(boost_cart.modpath.."/functions.lua")
|
|
|
|
dofile(boost_cart.modpath.."/rails.lua")
|
2016-04-15 09:45:26 +02:00
|
|
|
|
2016-11-22 20:32:17 +01:00
|
|
|
if minetest.global_exists("mesecon") then
|
|
|
|
dofile(boost_cart.modpath.."/detector.lua")
|
|
|
|
--else
|
|
|
|
-- minetest.register_alias("carts:powerrail", "boost_cart:detectorrail")
|
|
|
|
-- minetest.register_alias("carts:powerrail", "boost_cart:detectorrail_on")
|
2014-07-22 23:15:43 +02:00
|
|
|
end
|
|
|
|
|
2016-11-22 20:32:17 +01:00
|
|
|
boost_cart.mtg_compat = minetest.global_exists("carts") and carts.pathfinder
|
|
|
|
if boost_cart.mtg_compat then
|
|
|
|
minetest.log("action", "[boost_cart] Overwriting definitions of similar carts mod")
|
2014-07-22 23:15:43 +02:00
|
|
|
end
|
2016-11-22 20:32:17 +01:00
|
|
|
dofile(boost_cart.modpath.."/cart_entity.lua")
|