File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Data/Base.rte/Devices/Tools/Constructor Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -326,11 +326,19 @@ function Update(self)
326326 end
327327 else
328328 for i = 1 , self .RoundsFired do
329- local trace = Vector (self .digLength , 0 ):RadRotate (angle + RangeRand (- 1 , 1 ) * self .spreadRange );
330- local digPos = ConstructorTerrainRay (self .MuzzlePos , trace , 0 );
331329
332- if SceneMan :GetTerrMatter (digPos .X , digPos .Y ) ~= rte .airID then
330+ local trace , digPos , diggingAir
331+ for _ = 1 , 5 do
332+ -- Try up to 5 times to find a pixel to dig
333+ trace = Vector (self .digLength , 0 ):RadRotate (angle + RangeRand (- 1 , 1 ) * self .spreadRange );
334+ digPos = ConstructorTerrainRay (self .MuzzlePos , trace , 0 );
335+ diggingAir = SceneMan :GetTerrMatter (digPos .X , digPos .Y ) == rte .airID
336+ if not diggingAir then
337+ break
338+ end
339+ end
333340
341+ if not diggingAir then
334342 local digWeightTotal = 0 ;
335343 local totalVel = Vector ();
336344 local found = 0 ;
@@ -609,4 +617,4 @@ function Update(self)
609617 elseif self .cursor then
610618 self .cursor = nil ;
611619 end
612- end
620+ end
You can’t perform that action at this time.
0 commit comments