mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-05 10:00:26 +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
4a25fa3f89
commit
9564156b2f
|
@ -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