1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

Added security in carts about driver's yaw calculation

- Thanks to @crabman77 for having reported the issue
This commit is contained in:
LeMagnesium 2015-01-17 00:51:52 +01:00
parent 3bd75abd88
commit 20aa788dd6

View File

@ -543,6 +543,9 @@ function cart:on_step(dtime)
self.yawtarget=newyaw -- Set new target. self.yawtarget=newyaw -- Set new target.
-- minetest.log("action", "--Cart yawtarget set "..self.yawtarget) -- minetest.log("action", "--Cart yawtarget set "..self.yawtarget)
end end
if self.driver:get_look_yaw() == nil then
return
end
local playeryaw=self.driver:get_look_yaw()-1.57 local playeryaw=self.driver:get_look_yaw()-1.57
if playeryaw<0 then playeryaw=playeryaw+(math.pi*2) end if playeryaw<0 then playeryaw=playeryaw+(math.pi*2) end
if self.yawtarget and playeryaw ~= self.yawtarget then if self.yawtarget and playeryaw ~= self.yawtarget then