summaryrefslogtreecommitdiff
path: root/boost_cart
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-06-17 19:34:42 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-06-17 19:34:42 -0400
commit3c3be04962a8c06ce9b5956e5799cdf3bbecf2aa (patch)
tree8578a1384609de55b26936b8be17891b9eae78cc /boost_cart
parent75e0a665ce2a45e1158a427d3f70f854f5f4d5a8 (diff)
downloaddreambuilder_modpack-3c3be04962a8c06ce9b5956e5799cdf3bbecf2aa.tar
dreambuilder_modpack-3c3be04962a8c06ce9b5956e5799cdf3bbecf2aa.tar.gz
dreambuilder_modpack-3c3be04962a8c06ce9b5956e5799cdf3bbecf2aa.tar.bz2
dreambuilder_modpack-3c3be04962a8c06ce9b5956e5799cdf3bbecf2aa.tar.xz
dreambuilder_modpack-3c3be04962a8c06ce9b5956e5799cdf3bbecf2aa.zip
update castle modpack, areas, blox, boost_cart, currency, farming redo, homedecor, and pipeworks
Diffstat (limited to 'boost_cart')
-rw-r--r--boost_cart/README.txt3
-rw-r--r--boost_cart/init.lua13
-rw-r--r--boost_cart/settingtypes.txt6
3 files changed, 19 insertions, 3 deletions
diff --git a/boost_cart/README.txt b/boost_cart/README.txt
index 7565ee8..9442926 100644
--- a/boost_cart/README.txt
+++ b/boost_cart/README.txt
@@ -7,7 +7,8 @@ Target: Run smoothly as possible even on laggy server
Features
----------
-- A fast cart for your railway or roller coaster (up to 10 m/s!)
+- A fast cart for your railway or roller coaster
+- Easily configurable cart speed using the Advanced Settings
- Boost and brake rails
- By mesecons controlled Start-Stop rails
- Detector rails that send a mesecons signal when the cart drives over them
diff --git a/boost_cart/init.lua b/boost_cart/init.lua
index bfae5d9..b9e0c67 100644
--- a/boost_cart/init.lua
+++ b/boost_cart/init.lua
@@ -2,10 +2,19 @@
boost_cart = {}
boost_cart.modpath = minetest.get_modpath("boost_cart")
+
+-- Settings glue for <= 0.4.15
+local setting_getter = minetest.setting_get
+if minetest.settings then
+ setting_getter = function (key)
+ return minetest.settings:get(key)
+ end
+end
+
-- Maximal speed of the cart in m/s
-boost_cart.speed_max = 10
+boost_cart.speed_max = tonumber(setting_getter("boost_cart.speed_max")) or 10
-- Set to -1 to disable punching the cart from inside
-boost_cart.punch_speed_max = 7
+boost_cart.punch_speed_max = tonumber(setting_getter("boost_cart.punch_speed_max")) or 7
if not boost_cart.modpath then
diff --git a/boost_cart/settingtypes.txt b/boost_cart/settingtypes.txt
new file mode 100644
index 0000000..d64d88a
--- /dev/null
+++ b/boost_cart/settingtypes.txt
@@ -0,0 +1,6 @@
+# Maximal speed of the cart in m/s (min=1, max=100)
+boost_cart.speed_max (Maximal speed) int 10 1 100
+
+# Maximal speed to which the driving player can accelerate the cart by punching
+# from inside the cart. -1 will disable this feature. (min=-1, max=100)
+boost_cart.punch_speed_max (Maximal punch speed) int 7 -1 100 \ No newline at end of file