Skip to content

Commit

Permalink
Merge pull request #274 from GMLambda/fix-error
Browse files Browse the repository at this point in the history
Fix physcannon causing errors in some cases
  • Loading branch information
ZehMatt authored May 18, 2024
2 parents 55564f6 + 00c7ea6 commit 8decf5c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions entities/weapons/weapon_physcannon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1639,9 +1639,7 @@ function SWEP:DoEffectLaunch(pos, matType, normal)
local shotDir
local controller = self:GetMotionController()
local attachedEnt = controller:GetAttachedObject()
if matType == nil then
matType = 0
end

if pos == nil then

if attachedEnt ~= nil then
Expand Down Expand Up @@ -1679,6 +1677,10 @@ function SWEP:DoEffectLaunch(pos, matType, normal)
normal = shotDir:GetNormalized()
end

if matType == nil then
matType = 0
end

shotDir:Normalize()
local ef = EffectData()
ef:SetOrigin(endPos)
Expand Down

0 comments on commit 8decf5c

Please sign in to comment.