mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
Added security in carts about driver's yaw calculation
- Thanks to @crabman77 for having reported the issue
This commit is contained in:
parent
3bd75abd88
commit
20aa788dd6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user