Skip to content

Commit

Permalink
Fixed: Use the proper key when doing a trace
Browse files Browse the repository at this point in the history
Optimized: Localize trace.start for speed
  • Loading branch information
dvdvideo1234 committed Oct 22, 2021
1 parent df5a0f7 commit ad4e811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/stargate/shared/tracelines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ function StarGate.Trace:New(start,dir,ignore,mask,cogrp,iworld,width)
end
end
-- START OF Lynix modification
local min; -- Minimum distance is the first entry @dvdvideo1234
local anc, min = trace.start -- First entry minumum @dvdvideo1234
for i = 1, #trace_array do -- Interger loop for arrays @dvdvideo1234
local v = trace_array[i]
local m = trace.StartPos:Distance(v.HitPos);
local m = anc:Distance(v.HitPos)
if(not min or m < min) then
min = m;
trace = v;
Expand Down

0 comments on commit ad4e811

Please sign in to comment.