get rid of unecessary "if true" statement

This commit is contained in:
epCode 2022-10-09 16:57:26 -07:00 committed by Gitea
parent ef980f2ea0
commit 4a086db4c5
1 changed files with 32 additions and 33 deletions

View File

@ -336,8 +336,9 @@ end
local set_yaw = function(self, yaw, delay, dtime) local set_yaw = function(self, yaw, delay, dtime)
if self.noyaw then return end if self.noyaw then return end
if true then
self._turn_to = yaw self._turn_to = yaw
--clamp our yaw to a 360 range --clamp our yaw to a 360 range
if math.deg(self.object:get_yaw()) > 360 then if math.deg(self.object:get_yaw()) > 360 then
@ -372,16 +373,14 @@ local set_yaw = function(self, yaw, delay, dtime)
end end
end end
return yaw
end
delay = delay or 0 delay = delay or 0
yaw = self.object:get_yaw()
if delay == 0 then if delay == 0 then
if self.shaking and dtime then if self.shaking and dtime then
yaw = yaw + (random() * 2 - 1) * 5 * dtime yaw = yaw + (random() * 2 - 1) * 5 * dtime
end end
self.object:set_yaw(yaw)
update_roll(self) update_roll(self)
return yaw return yaw
end end