semperfi: Fix bug that made us never build incendry, and less often upgrade.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10761 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-05-02 13:08:32 +00:00 committed by Git SVN Gateway
parent fac1b9d48a
commit b54fd792ab
1 changed files with 36 additions and 38 deletions

View File

@ -814,7 +814,7 @@ event buildFundamentals(inactive)
setEventTrigger(buildDerrick, chainloadTr);
exit;
}
else // if lots of power and too few factories to replace high-risk oil hunting trucks
else // if lots of power or too few factories to replace high-risk oil hunting trucks
{
dbgPlr("Too much power - EXPAND!");
setEventTrigger(buildExpand, chainloadTr);
@ -1544,45 +1544,43 @@ event newfortify(inactive)
_maxBuilders = 1;
setEventTrigger(newfortify, inactive);
if(numGroupSameOrder(buildGroup, DORDER_LINEBUILD) >= _maxBuilders) // only gateway fortifications use line build
if (numGroupSameOrder(buildGroup, DORDER_LINEBUILD) < _maxBuilders) // only gateway fortifications use line build
{
exit;
}
boolResult = FALSE;
initIterateGroup(buildGroup); // find idle an idle veh.in build group.
droid = iterateGroup(buildGroup);
while((boolResult == FALSE) and (droid != NULLOBJECT))
{
if (droid.order != DORDER_BUILD and droid.order != DORDER_LINEBUILD and droid.order != DORDER_HELPBUILD)
{
boolResult = TRUE; // dont do this again!
tempx = baseX;
tempy = baseY;
// choose a suitable turret.
count = numWallWeaps - 1;
count2 = 0;
while( (count2 < 3) and (count >= 0) )
{
if( isStructureAvailable(wallWeaps[count],me))
{
structChoice[count2] = wallWeaps[count];
count2 = count2 + 1;
}
count = count - 1;
}
count =0;
if((count2 > 0) and (_numBuilders < _maxBuilders))
{
count = random(count2);
skDefenseLocationB(ref tempx,ref tempy,wall,structChoice[count],droid,me);
_numBuilders++;
}
}
boolResult = FALSE;
initIterateGroup(buildGroup); // find idle an idle veh.in build group.
droid = iterateGroup(buildGroup);
while((boolResult == FALSE) and (droid != NULLOBJECT))
{
if (droid.order != DORDER_BUILD and droid.order != DORDER_LINEBUILD and droid.order != DORDER_HELPBUILD)
{
boolResult = TRUE; // dont do this again!
tempx = baseX;
tempy = baseY;
// choose a suitable turret.
count = numWallWeaps - 1;
count2 = 0;
while ((count2 < 3) and (count >= 0))
{
if (isStructureAvailable(wallWeaps[count], me))
{
structChoice[count2] = wallWeaps[count];
count2 = count2 + 1;
}
count = count - 1;
}
count = 0;
if ((count2 > 0) and (_numBuilders < _maxBuilders))
{
count = random(count2);
skDefenseLocationB(ref tempx, ref tempy, wall, structChoice[count], droid, me);
_numBuilders++;
}
}
droid = iterateGroup(buildGroup);
}
}
if (idleGroup(buildGroup) > 0 and !tryUpgrade())
{