From acf697cd43a8589669570f8492ff3b0b02e53ec8 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 28 Mar 2017 18:01:42 +0200 Subject: [PATCH] Fix crash caused by stop rail and 8b4487c (#15) --- cart_entity.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cart_entity.lua b/cart_entity.lua index 07a7d69..1633758 100644 --- a/cart_entity.lua +++ b/cart_entity.lua @@ -264,8 +264,12 @@ function cart_entity:on_step(dtime) end end - -- Slow down or speed up, depending on Y direction - acc = acc + dir.y * -2 + if acc then + -- Slow down or speed up, depending on Y direction + acc = acc + dir.y * -2 + else + acc = 0 + end if self.old_dir.y ~= 1 and not self.punched then -- Stop the cart swing between two rail parts (handbrake)