Skip to content

Commit

Permalink
Failsafe for dead engineer in ProcessBuildCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Uveso authored and shalkya committed Aug 10, 2020
1 parent 7a970c7 commit 7fe5f31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/platoon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3603,6 +3603,9 @@ Platoon = Class(moho.platoon_methods) {
end
-- see if we can move there first
if AIUtils.EngineerMoveWithSafePath(aiBrain, eng, buildLocation) then
if not eng or eng.Dead or not eng.PlatoonHandle or not aiBrain:PlatoonExists(eng.PlatoonHandle) then
return
end
-- issue buildcommand to block other engineers from caping mex/hydros or to reserve the buildplace
aiBrain:BuildStructure(eng, whatToBuild, {buildLocation[1], buildLocation[3], 0}, buildRelative)
-- wait until we are close to the buildplace so we have intel
Expand Down

0 comments on commit 7fe5f31

Please sign in to comment.