Only automatically repair completed buildings, and do not help build automatically anymore (was bugged).

master
Gerard Krol 2009-04-04 23:56:18 +02:00
parent 510d8d7735
commit c6690fa894
2 changed files with 5 additions and 18 deletions

View File

@ -246,7 +246,8 @@ BASE_OBJECT * checkForDamagedStruct(DROID *psDroid, STRUCTURE *psTarget)
for (; psCurr != NULL; psCurr = psCurr->psNext)
{
//check for damage
if (structIsDamaged(psCurr) &&
if (psCurr->status == SS_BUILT &&
structIsDamaged(psCurr) &&
visibleObject((BASE_OBJECT *)psDroid, (BASE_OBJECT *)psCurr, false))
{
//check for within range
@ -365,14 +366,7 @@ void orderUpdateDroid(DROID *psDroid)
psObj = checkForDamagedStruct(psDroid,NULL);
if (psObj && (!bMultiPlayer || myResponsibility(psDroid->player)))
{
if (psStruct->status == SS_BUILT)
{
orderDroidObj(psDroid, DORDER_REPAIR, psObj);
}
else
{
orderDroidObj(psDroid, DORDER_HELPBUILD, psObj);
}
orderDroidObj(psDroid, DORDER_REPAIR, psObj);
}
}
@ -1245,14 +1239,7 @@ void orderUpdateDroid(DROID *psDroid)
}
if (psObj)
{
if (psStruct->status == SS_BUILT)
{
orderDroidObj(psDroid, DORDER_REPAIR, psObj);
}
else
{
orderDroidObj(psDroid, DORDER_HELPBUILD, psObj);
}
orderDroidObj(psDroid, DORDER_REPAIR, psObj);
}
}
break;

View File

@ -1224,7 +1224,7 @@ void structureBuild(STRUCTURE *psStruct, DROID *psDroid, int buildPoints)
psStruct->body += after - before;
//check if structure is built
if (psStruct->currentBuildPts > (SDWORD)psStruct->pStructureType->buildPoints)
if (psStruct->currentBuildPts >= (SDWORD)psStruct->pStructureType->buildPoints)
{
psStruct->currentBuildPts = (SWORD)psStruct->pStructureType->buildPoints;
psStruct->status = SS_BUILT;