From a879ce8d3c179b5c6b88c9db610d560228d1e5b4 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 9 Jun 2016 17:35:06 +0200 Subject: Fix train collision and coupling on opposing trains, and try to implement animation (currently does not work) --- helpers.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'helpers.lua') 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 -- cgit v1.2.3