@@ -266,10 +266,9 @@ local function CalcStrafe()
266
266
-- Save the average delta
267
267
avgDeltas [entityIndex ] = avgDelta
268
268
269
- -- Create two vectors adjusted by their past and current average delta in the yaw direction at a distance of 12 units
270
- local vector1 = Vector3 (math.cos (math.rad (lastDeltas [entityIndex ] or delta )) * 12 , math.sin (math.rad (lastDeltas [entityIndex ] or delta )) * 12 , 0 )
271
- local vector2 = Vector3 (math.cos (math.rad (avgDelta )) * 12 , math.sin (math.rad (avgDelta )) * 12 , 0 )
272
-
269
+ local vector1 = Vector3 (1 , 0 , 0 )
270
+ local vector2 = Vector3 (1 , 0 , 0 )
271
+
273
272
-- Apply deviation
274
273
local ang1 = vector1 :Angles ()
275
274
ang1 .y = ang1 .y + (lastDeltas [entityIndex ] or delta )
502
501
local inaccuracyValue = inaccuracy [vPlayer :GetIndex ()]
503
502
if not inaccuracyValue then return nil end
504
503
505
- local hitbox_min_trigger = Vector3 ( drawVhitbox [1 ]. x + inaccuracyValue , drawVhitbox [ 1 ]. y + inaccuracyValue , drawVhitbox [ 1 ]. z )
506
- local hitbox_max_trigger = Vector3 ( drawVhitbox [2 ]. x - inaccuracyValue , drawVhitbox [ 2 ]. y - inaccuracyValue , drawVhitbox [ 2 ]. z )
504
+ local hitbox_min_trigger = drawVhitbox [1 ]
505
+ local hitbox_max_trigger = drawVhitbox [2 ]
507
506
508
507
-- Calculate the closest point on the hitbox to the sphere
509
508
local closestPoint = Vector3 (
@@ -514,25 +513,13 @@ end
514
513
515
514
-- Calculate the vector from the closest point to the sphere center
516
515
local distanceAlongVector = (spherePos - closestPoint ):Length ()
517
- if isAdvanced then
518
- local atackPos = Normalize (spherePos - closestPoint ) * sphereRadius
519
-
520
516
-- Compare the distance along the vector to the sum of the radius
521
517
if sphereRadius > distanceAlongVector then
522
518
return true , closestPoint
523
519
else
524
520
-- Not InRange
525
521
return false , nil
526
522
end
527
- else
528
- -- Compare the distance along the vector to the sum of the radius
529
- if sphereRadius > distanceAlongVector then
530
- return true , closestPoint
531
- else
532
- -- Not InRange
533
- return false , nil
534
- end
535
- end
536
523
end
537
524
538
525
775
762
stepSize = pLocal :GetPropFloat (" localdata" , " m_flStepSize" )
776
763
777
764
CalcStrafe ()
765
+ if inaccuracyValue then
766
+ swingrange = swingrange - inaccuracyValue
767
+ end
778
768
779
769
-- Local player prediction
780
770
if pLocal :EstimateAbsVelocity () == 0 then
0 commit comments