@@ -989,20 +989,17 @@ function HumanBehaviors.WeaponSearch(AI, Owner, Abort)
989
989
end
990
990
991
991
if MovableMan :ValidMO (device ) and pathMultipler ~= - 1 then
992
- local simpleDistance = SceneMan :ShortestDistance (Owner .Pos , device .Pos , false ) * pathMultipler ;
993
- if simpleDistance < maxPathLength then
994
- local deviceID = device .UniqueID ;
995
- SceneMan .Scene :CalculatePathAsync (
996
- function (pathRequest )
997
- local pathLength = pathRequest .PathLength * pathMultipler ;
998
- if pathLength < maxPathLength then
999
- table.insert (devicesToPickUp , {deviceId = deviceID , score = score });
1000
- end
1001
- searchesRemaining = searchesRemaining - 1 ;
1002
- end ,
1003
- Owner .Pos , device .Pos , false , Owner .DigStrength , Owner .Team
1004
- );
1005
- end
992
+ local deviceID = device .UniqueID ;
993
+ SceneMan .Scene :CalculatePathAsync (
994
+ function (pathRequest )
995
+ local pathLength = pathRequest .PathLength * pathMultipler ;
996
+ if pathLength < maxPathLength then
997
+ table.insert (devicesToPickUp , {deviceId = deviceID , score = score });
998
+ end
999
+ searchesRemaining = searchesRemaining - 1 ;
1000
+ end ,
1001
+ Owner .Pos , device .Pos , false , Owner .DigStrength , Owner .Team
1002
+ );
1006
1003
end
1007
1004
end
1008
1005
@@ -1107,20 +1104,17 @@ function HumanBehaviors.ToolSearch(AI, Owner, Abort)
1107
1104
for _ , deviceEntry in pairs (devices ) do
1108
1105
local device = deviceEntry .device ;
1109
1106
if MovableMan :ValidMO (device ) then
1110
- local simpleDistance = SceneMan :ShortestDistance (Owner .Pos , device .Pos , false );
1111
- if simpleDistance < maxPathLength then
1112
- local deviceId = device .UniqueID ;
1113
- SceneMan .Scene :CalculatePathAsync (
1114
- function (pathRequest )
1115
- local pathLength = pathRequest .PathLength ;
1116
- if pathRequest .Status ~= PathRequest .NoSolution and pathLength < maxPathLength then
1117
- table.insert (devicesToPickUp , {deviceId = deviceId , score = pathLength });
1118
- end
1119
- searchesRemaining = searchesRemaining - 1 ;
1120
- end ,
1121
- Owner .Pos , device .Pos , false , Owner .DigStrength , Owner .Team
1122
- );
1123
- end
1107
+ local deviceId = device .UniqueID ;
1108
+ SceneMan .Scene :CalculatePathAsync (
1109
+ function (pathRequest )
1110
+ local pathLength = pathRequest .PathLength ;
1111
+ if pathRequest .Status ~= PathRequest .NoSolution and pathLength < maxPathLength then
1112
+ table.insert (devicesToPickUp , {deviceId = deviceId , score = pathLength });
1113
+ end
1114
+ searchesRemaining = searchesRemaining - 1 ;
1115
+ end ,
1116
+ Owner .Pos , device .Pos , false , Owner .DigStrength , Owner .Team
1117
+ );
1124
1118
end
1125
1119
end
1126
1120
0 commit comments