From 9564156b2f48c241dd1c476ae255c320e2bf8ed8 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Sat, 17 Jan 2015 00:51:52 +0100 Subject: [PATCH] Added security in carts about driver's yaw calculation - Thanks to @crabman77 for having reported the issue --- mods/carts/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/carts/init.lua b/mods/carts/init.lua index acea8fc4..722325b7 100755 --- a/mods/carts/init.lua +++ b/mods/carts/init.lua @@ -543,6 +543,9 @@ function cart:on_step(dtime) self.yawtarget=newyaw -- Set new target. -- minetest.log("action", "--Cart yawtarget set "..self.yawtarget) end + if self.driver:get_look_yaw() == nil then + return + end local playeryaw=self.driver:get_look_yaw()-1.57 if playeryaw<0 then playeryaw=playeryaw+(math.pi*2) end if self.yawtarget and playeryaw ~= self.yawtarget then