mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-28 12:53: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()
|
function SWEP:PrimaryAttack()
|
||||||
self:CallOnClient("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
|
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)
|
table.insert(self.points, ply:EyePos() + ply:EyeAngles():Forward() * 50)
|
||||||
|
@ -77,17 +77,21 @@ end
|
||||||
function SWEP:SecondaryAttack()
|
function SWEP:SecondaryAttack()
|
||||||
self:CallOnClient("SecondaryAttack")
|
self:CallOnClient("SecondaryAttack")
|
||||||
|
|
||||||
local ply = self.Owner
|
local ply = self:GetOwner()
|
||||||
|
|
||||||
self.center:Set(ply:GetEyeTrace().HitPos)
|
self.center:Set(ply:GetEyeTrace().HitPos)
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("PostDrawTranslucentRenderables", "ShapeGun", function()
|
hook.Add("PostDrawTranslucentRenderables", "ShapeGun", function()
|
||||||
local ply = Entity(1)
|
local ply = self:GetOwner()
|
||||||
local wep = ply:GetActiveWeapon() or nil
|
|
||||||
|
|
||||||
if IsValid(wep) and wep:GetClass() == "shapedrawer" then
|
if not ply:IsValid() then return end
|
||||||
for k, v in ipairs(wep.points) do
|
|
||||||
|
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))
|
render.DrawWireframeBox(v, angle_zero, Vector(-1, -1, -1), Vector(1, 1, 1))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue