diff options
Diffstat (limited to 'helpers.lua')
-rw-r--r-- | helpers.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/helpers.lua b/helpers.lua index 737d15b..cd67aa9 100644 --- a/helpers.lua +++ b/helpers.lua @@ -219,4 +219,7 @@ function advtrains.get_real_index_position(path, index) end
function advtrains.pos_median(pos1, pos2)
return {x=pos1.x-(pos1.x-pos2.x)*0.5, y=pos1.y-(pos1.y-pos2.y)*0.5, z=pos1.z-(pos1.z-pos2.z)*0.5}
+end
+function advtrains.abs_ceil(i)
+ return math.ceil(math.abs(i))*math.sign(i)
end
\ No newline at end of file |