mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Fix turret behavior if parented (#2184)
This commit is contained in:
parent
f8335f9711
commit
f888eb12e7
@ -43,9 +43,16 @@ function ENT:FireShot()
|
||||
self:EmitSound( self.sound )
|
||||
end
|
||||
|
||||
local phys = self:GetPhysicsObject()
|
||||
local shootOrigin = phys:LocalToWorld(self.attachmentPos)
|
||||
local shootAngles = phys:GetAngles()
|
||||
local shootOrigin, shootAngles
|
||||
local parent = self:GetParent()
|
||||
if parent:IsValid() then
|
||||
shootOrigin = self:LocalToWorld(self.attachmentPos)
|
||||
shootAngles = self:GetAngles()
|
||||
else
|
||||
local phys = self:GetPhysicsObject()
|
||||
shootOrigin = phys:LocalToWorld(self.attachmentPos)
|
||||
shootAngles = phys:GetAngles()
|
||||
end
|
||||
|
||||
-- Shoot a bullet
|
||||
local bullet = {}
|
||||
|
Loading…
Reference in New Issue
Block a user