parallel node bugfixes

code cleanup
This commit is contained in:
devZoGok
2025-03-14 19:58:21 +02:00
parent 2590cb255b
commit 31f9d4f643
3 changed files with 16 additions and 20 deletions
+3 -12
View File
@@ -151,24 +151,16 @@ function Player:startHarvesting()
end
end
extractors = self:getUnitsByClass(UnitClass.EXTRACTOR, 1)
if #extractors == 0 then return BTNodeResult.FAILURE end
extractor = self:getUnitsByClass(UnitClass.EXTRACTOR, 1)[1]
if not extractor then return BTNodeResult.FAILURE end
self:deselectUnits()
self:selectUnits({harvesters[1]})
self:issueOrder(7, Vector3:new(0, 0, 0), {Target:new(extractors[1], Vector3:new(0, 0, 0))}, false)
self:issueOrder(7, Vector3:new(0, 0, 0), {Target:new(extractor, Vector3:new(0, 0, 0))}, false)
return BTNodeResult.SUCCESS
end
function Player:buildTaskforceUnitGroup(numUnits, currNumUnits, factory, buId)
if currNumUnits < numUnits then
for i = 1, numUnits - currNumUnits do
factory:appendToQueue(buId)
end
end
end
function Player:buildTaskForces(arguments)
landFactory = self:getUnitsByClass(UnitClass.LAND_FACTORY, 1)[1]
@@ -207,7 +199,6 @@ end
function Player:formTaskForce(arguments)
if self.taskForces[arguments.tfId] then return BTNodeResult.SUCCESS end
--elseif arguments.spId == self:getSpawnPointId() + 1 then return BTNodeResult.FAILURE
unitGroups = {}