Skip to content

Commit

Permalink
increase search distance for first factory position
Browse files Browse the repository at this point in the history
  • Loading branch information
eronoobos committed Aug 4, 2016
1 parent 317ced1 commit ff98164
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions factorybuildershandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,21 @@ function FactoryBuildersHandler:FactoryPosition(factoryName,builder)
local utype = game:GetTypeByName(factoryName)
local mtype = factoryMobilities[factoryName][1]
local builderPos = builder:GetPosition()
local factoryPos
local p
if p == nil then
self:EchoDebug("looking next to last nano turrets for " .. factoryName)
self:EchoDebug("looking next to nano turrets for " .. factoryName)
p = ai.buildsitehandler:BuildNearNano(builder, utype)
end
if p == nil then
self:EchoDebug("looking next to factory for " .. factoryName)
local factoryPos = ai.buildsitehandler:ClosestHighestLevelFactory(builderPos, 10000)
factoryPos = ai.buildsitehandler:ClosestHighestLevelFactory(builderPos, 10000)
if factoryPos then
p = ai.buildsitehandler:ClosestBuildSpot(builder, factoryPos, utype)
end
end
if p == nil then
self:EchoDebug('builfactory near hotSpot')
local factoryPos = ai.buildsitehandler:ClosestHighestLevelFactory(builderPos, 10000)
local place = false
local distance = 99999
if factoryPos then
Expand Down Expand Up @@ -202,7 +202,7 @@ function FactoryBuildersHandler:FactoryPosition(factoryName,builder)
end
if p == nil then
self:EchoDebug("trying near builder for " .. factoryName)
p = ai.buildsitehandler:ClosestBuildSpot(builder, builderPos, utype)
p = ai.buildsitehandler:ClosestBuildSpot(builder, builderPos, utype, 10, nil, nil, 1000) -- check at most 1000 elmos away
end
if p then
self:EchoDebug("position found for " .. factoryName)
Expand Down

0 comments on commit ff98164

Please sign in to comment.