Skip to content

Commit

Permalink
Do not allow Nexus AI to build hardened sensor towers before being re…
Browse files Browse the repository at this point in the history
…searched.

Fixes ticket:4025.
  • Loading branch information
Cyp committed May 25, 2013
1 parent 19fab1f commit d5dd591
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/droid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,15 @@ DroidStartBuild droidStartBuild(DROID *psDroid)
STRUCTURE_STATS *psStructStat = psDroid->order.psStats;
STRUCTURE_LIMITS *structLimit = &asStructLimits[psDroid->player][psStructStat - asStructureStats];

ItemAvailability ia = (ItemAvailability)apStructTypeLists[psDroid->player][psStructStat - asStructureStats];
if (ia != AVAILABLE && ia != REDUNDANT)
{
ASSERT(false, "Cannot build \"%s\" for player %d.", psStructStat->name.toUtf8().constData(), psDroid->player);
intBuildFinished(psDroid);
cancelBuild(psDroid);
return DroidStartBuildFailed;
}

//need to check structLimits have not been exceeded
if (structLimit->currentQuantity >= structLimit->limit)
{
Expand Down

0 comments on commit d5dd591

Please sign in to comment.