Skip to content

Commit

Permalink
Fix physObj error on invalid physics (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
riggs9162 authored Sep 4, 2024
1 parent da53d75 commit 1d5998e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gamemode/core/hooks/sv_hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ function GM:PlayerCanPickupWeapon(client, weapon)
end

function GM:OnPhysgunFreeze(weapon, physObj, entity, client)
-- Validate the physObj, to prevent errors on entities who have no physics object
if (!IsValid(physObj)) then return false end

-- Object is already frozen (!?)
if (!physObj:IsMoveable()) then return false end
if (entity:GetUnFreezable()) then return false end
Expand Down

0 comments on commit 1d5998e

Please sign in to comment.