aboutsummaryrefslogtreecommitdiff
path: root/advtrains/helpers.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-03-09 11:29:22 +0100
committerorwell96 <orwell@bleipb.de>2019-03-09 11:29:22 +0100
commit7149137990dce85d856feb126df711c3c43087db (patch)
tree92cc201e1cc5c3be6eeb7b64a04644e39f71f80e /advtrains/helpers.lua
parentbc31f205cd7433e2f364491d8c76ce0d6504d457 (diff)
downloadadvtrains-7149137990dce85d856feb126df711c3c43087db.tar.gz
advtrains-7149137990dce85d856feb126df711c3c43087db.tar.bz2
advtrains-7149137990dce85d856feb126df711c3c43087db.zip
Add setting for death behavior and implement damage checks better
Diffstat (limited to 'advtrains/helpers.lua')
-rw-r--r--advtrains/helpers.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua
index 3514f55..e04991e 100644
--- a/advtrains/helpers.lua
+++ b/advtrains/helpers.lua
@@ -232,6 +232,16 @@ function advtrains.is_creative(name)
return minetest.settings:get_bool("creative_mode")
end
+function advtrains.is_damage_enabled(name)
+ if not name then
+ error("advtrains.is_damage_enabled() called without name parameter!")
+ end
+ if minetest.check_player_privs(name, "train_admin") then
+ return false
+ end
+ return minetest.settings:get_bool("enable_damage")
+end
+
function advtrains.ms_to_kmh(speed)
return speed * 3.6
end