Skip to content

Commit

Permalink
Check Valid phys first
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyunge committed Apr 17, 2024
1 parent d2e1d53 commit 3739027
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/entities/acf_gearbox_update/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ do -- Braking ------------------------------------------
if not self.Braking then return end -- Kills the whole thing if its not supposed to be running
if not next(self.Wheels) then return end -- No brakes for the non-wheel users
if self.LastBrake == Clock.CurTime then return end -- Don't run this twice in a tick

if not IsValid(Contraption.GetAncestor(self):GetPhysicsObject()) then return end
local BoxPhys = Contraption.GetAncestor(self):GetPhysicsObject()
local SelfWorld = BoxPhys:LocalToWorldVector(BoxPhys:GetAngleVelocity())
local DeltaTime = Clock.DeltaTime
Expand Down

0 comments on commit 3739027

Please sign in to comment.