Only automatically repair completed buildings, and do not help build automatically anymore (was bugged).
parent
510d8d7735
commit
c6690fa894
21
src/order.c
21
src/order.c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue