diff options
author | lemon-melon <lemon-melon@users.noreply.github.com> | 2017-07-15 16:01:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-15 16:01:15 +0100 |
commit | efc319f87737ed4db13db9e8373cb3406414cdfb (patch) | |
tree | 5ae8592cc809bdff145e02f1c4b2f0f5e74b046a | |
parent | a34ff7664af45864151d55bd41e2031b322affe2 (diff) | |
download | advtrains-efc319f87737ed4db13db9e8373cb3406414cdfb.tar.gz advtrains-efc319f87737ed4db13db9e8373cb3406414cdfb.tar.bz2 advtrains-efc319f87737ed4db13db9e8373cb3406414cdfb.zip |
Add m/s to km/h helper function
-rw-r--r-- | advtrains/advtrains/helpers.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/advtrains/advtrains/helpers.lua b/advtrains/advtrains/helpers.lua index df2d9a8..91c0c1c 100644 --- a/advtrains/advtrains/helpers.lua +++ b/advtrains/advtrains/helpers.lua @@ -81,7 +81,7 @@ function advtrains.conway(midreal, prev, drives_on)--in order prev,mid,return --dir2???
local cor2=advtrains.dirCoordSet(mid, middir1)--<<<<
if math.floor(cor2.x+0.5)==math.floor(prev.x+0.5) and math.floor(cor2.z+0.5)==math.floor(prev.z+0.5) then
- next=advtrains.dirCoordSet(mid, middir2)--dir2 wird überprüft, alles gut.
+ next=advtrains.dirCoordSet(mid, middir2)--dir2 wird überprüft, alles gut.
if midrely2>=1 then
next.y=next.y+1
--atprint("found midrely2 to be >=1: next is now "..(next and minetest.pos_to_string(next) or "nil"))
@@ -170,7 +170,7 @@ function advtrains.minAngleDiffRad(r1, r2) return try3
end
end
- +
function advtrains.dumppath(path)
atlog("Dumping a path:")
if not path then atlog("dumppath: no path(nil)") return end
@@ -260,3 +260,7 @@ function advtrains.is_protected(pos, name) end
return minetest.is_protected(pos, name)
end
+
+function advtrains.ms_to_kmh(speed)
+ return speed * 3.6
+end
|