mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-27 20:43:02 +05:00
infinite error should be fixed
This commit is contained in:
parent
de7e1ea356
commit
61eec80918
1 changed files with 10 additions and 6 deletions
|
@ -67,7 +67,7 @@ end
|
|||
|
||||
function SWEP:PrimaryAttack()
|
||||
self:CallOnClient("PrimaryAttack")
|
||||
local ply = self.Owner
|
||||
local ply = self:GetOwner()
|
||||
|
||||
if not self.points[#self.points] or (ply:EyePos() + ply:EyeAngles():Forward() * 50):Distance(self.points[#self.points]) > 5 then
|
||||
table.insert(self.points, ply:EyePos() + ply:EyeAngles():Forward() * 50)
|
||||
|
@ -77,17 +77,21 @@ end
|
|||
function SWEP:SecondaryAttack()
|
||||
self:CallOnClient("SecondaryAttack")
|
||||
|
||||
local ply = self.Owner
|
||||
local ply = self:GetOwner()
|
||||
|
||||
self.center:Set(ply:GetEyeTrace().HitPos)
|
||||
end
|
||||
|
||||
hook.Add("PostDrawTranslucentRenderables", "ShapeGun", function()
|
||||
local ply = Entity(1)
|
||||
local wep = ply:GetActiveWeapon() or nil
|
||||
local ply = self:GetOwner()
|
||||
|
||||
if IsValid(wep) and wep:GetClass() == "shapedrawer" then
|
||||
for k, v in ipairs(wep.points) do
|
||||
if not ply:IsValid() then return end
|
||||
|
||||
local wep = ply:GetActiveWeapon()
|
||||
local isShapeDrawer = wep:GetClass() == "shapedrawer"
|
||||
|
||||
if IsValid(wep) and isShapeDrawer then
|
||||
for _, v in ipairs(wep.points) do
|
||||
render.DrawWireframeBox(v, angle_zero, Vector(-1, -1, -1), Vector(1, 1, 1))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue