mirror of
https://github.com/Xerasin/Sit-Anywhere.git
synced 2025-03-04 03:13:07 -05:00
Merge branch 'master' into sitHolder
This commit is contained in:
commit
a3c66bddea
@ -98,6 +98,7 @@ end
|
||||
local currSit
|
||||
concommand.Add("+sit", function(ply, cmd, args)
|
||||
if currSit then return end
|
||||
if not IsValid(ply) or not ply.GetEyeTrace then return end
|
||||
currSit = DoSit(ply:GetEyeTrace())
|
||||
end)
|
||||
|
||||
|
@ -397,7 +397,8 @@ function META.Sit(ply, EyeTrace, ang, parent, parentbone, func, exit, wantedAng)
|
||||
|
||||
if math.abs(surfaceAng.pitch) <= 15 then
|
||||
ang = Angle()
|
||||
local dists, distsang, ang_smallest_hori, smallest_hori = SitAnywhere.GetAreaProfile(EyeTrace.HitPos, 24, false)
|
||||
local sampleResolution = 24
|
||||
local dists, distsang, ang_smallest_hori, smallest_hori = SitAnywhere.GetAreaProfile(EyeTrace.HitPos, sampleResolution, false)
|
||||
local infront = ((ang_smallest_hori or 0) + 180) % 360
|
||||
|
||||
|
||||
@ -432,18 +433,14 @@ function META.Sit(ply, EyeTrace, ang, parent, parentbone, func, exit, wantedAng)
|
||||
local trace = dists[I]
|
||||
local behind = distsang[(trace.ang + 180) % 360]
|
||||
if behind.Distance2 > 3 then
|
||||
local cost = 0
|
||||
if math.abs(eyeang.yaw - trace.ang) > 6 then
|
||||
cost = cost + 30
|
||||
end
|
||||
local tbl = {
|
||||
cost = cost,
|
||||
cost = math.abs(eyeang.yaw - trace.ang),
|
||||
ang = trace.ang,
|
||||
}
|
||||
table.insert(wants, tbl)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
table.sort(wants,function(a,b) return b.cost > a.cost end)
|
||||
if #wants == 0 then return end
|
||||
ang.yaw = (wants[1].ang - 90)
|
||||
|
Loading…
Reference in New Issue
Block a user