diff options
author | orwell96 <orwell@bleipb.de> | 2018-04-19 11:38:00 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-06-14 17:39:42 +0200 |
commit | 064a454117e6f921926f808ad91829e4b73664c0 (patch) | |
tree | 32cd2f68e672f4b1aa5c1c39b00ce586f7fd5c2f /advtrains/helpers.lua | |
parent | 3420a1a912b83917d6674c1fa14a3f884eb25bc2 (diff) | |
download | advtrains-064a454117e6f921926f808ad91829e4b73664c0.tar.gz advtrains-064a454117e6f921926f808ad91829e4b73664c0.tar.bz2 advtrains-064a454117e6f921926f808ad91829e4b73664c0.zip |
Adapt wagons to new path system
Still outstanding: trains
Diffstat (limited to 'advtrains/helpers.lua')
-rw-r--r-- | advtrains/helpers.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua index 5dbfd8d..70afadd 100644 --- a/advtrains/helpers.lua +++ b/advtrains/helpers.lua @@ -235,6 +235,16 @@ function advtrains.is_protected(pos, name) return minetest.is_protected(pos, name)
end
+function advtrains.is_creative(name)
+ if not name then
+ error("advtrains.is_creative() called without name parameter!")
+ end
+ if minetest.check_player_privs(name, {creative=true}) then
+ return true
+ end
+ return minetest.settings:get_bool("creative_mode")
+end
+
function advtrains.ms_to_kmh(speed)
return speed * 3.6
end
|