aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/itemsystem/weapons_common.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-11-27 22:02:47 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2016-11-27 22:02:47 -0500
commit2c4329e2b6e19182a441f79a5c3010011f8ae767 (patch)
treee4d8cd88690bed4cfacf2d4df39bdeed97b376f8 /gamemode/shared/itemsystem/weapons_common.lua
parent5f2a8015bd5d2a42e79038bb52f20260d8d97ba0 (diff)
downloadartery-2c4329e2b6e19182a441f79a5c3010011f8ae767.tar.gz
artery-2c4329e2b6e19182a441f79a5c3010011f8ae767.tar.bz2
artery-2c4329e2b6e19182a441f79a5c3010011f8ae767.zip
Vairous updates
Diffstat (limited to 'gamemode/shared/itemsystem/weapons_common.lua')
-rw-r--r--gamemode/shared/itemsystem/weapons_common.lua19
1 files changed, 7 insertions, 12 deletions
diff --git a/gamemode/shared/itemsystem/weapons_common.lua b/gamemode/shared/itemsystem/weapons_common.lua
index a7679a9..6f553fa 100644
--- a/gamemode/shared/itemsystem/weapons_common.lua
+++ b/gamemode/shared/itemsystem/weapons_common.lua
@@ -29,34 +29,28 @@ local positionset = {}
-- @param onhit A function to call on any entities that were hit in the swing of the weapon.
function ART.swingarc(player,times,positions,onhit)
local positionpoints = {}
- --[[
- local ea = player:EyeAngles()
- for k,v in pairs(positions) do
- print("Position that was at ", positions[k])
- positions[k].z = positions[k].z * math.sin(ea.pitch+90)
- print("Is now at",positions[k])
- end
- ]]
table.insert(positionset,positionpoints)
- local hitents = {}
for k,v in ipairs(times) do
timer.Simple(v,function()
+ ART.TraceWeapon = true
+ ART.TraceStart = CurTime()
+ print("positions[k]",positions[k],"playerpos",player:GetPos(),"add",Vector(0,0,64))
local weaponpos = positions[k] + player:GetPos() + Vector(0,0,64)
table.insert(positionpoints,weaponpos)
if #positionpoints > 1 then
+ --print("Trace from ", positionpoints[#positionpoints-1], " to ", positionpoints[#positionpoints])
local tr = util.TraceLine({
start = positionpoints[#positionpoints-1],
endpos = positionpoints[#positionpoints],
})
- if tr.Hit then
- onhit(tr)
- end
+ onhit(tr)
end
end)
end
timer.Simple(times[#times],function()
print("Inserted swing, drawn positions are now:")
PrintTable(positionset)
+ ART.TraceWeapon = false
end)
end
@@ -65,6 +59,7 @@ hook.Add( "HUDPaint", "weaponswings", function()
for k,v in pairs(positionset) do
for i = 1,#v-1 do
render.DrawLine( v[i], v[i+1], Color(255,0,0,255), false )
+ render.DrawLine( v[i], v[i]+Vector(0,0,20),Color(0,255,0,255),false)
end
end
--render.SetMaterial( material ) -- Tell render what material we want, in this case the flash from the gravgun