Skip to content

Commit

Permalink
Fixed a major regression preventing cloaking from working with the co…
Browse files Browse the repository at this point in the history
…mmand optimizer. May also affect other commands.
  • Loading branch information
heinermann committed Jan 25, 2015
1 parent e36a52d commit 27bcd3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bwapi/BWAPI/Source/GameUpdate.cpp
Expand Up @@ -430,12 +430,12 @@ void GameImpl::updateCommandOptimizer()
while ( cmd != commandOptimizer[i].end() )
{
// Ignore anything but the command that the unit last processed
if ( //static_cast<UnitImpl*>(cmd->unit)->lastImmediateCommandFrame == this->getFrameCount() &&
/*if ( //static_cast<UnitImpl*>(cmd->unit)->lastImmediateCommandFrame == this->getFrameCount() &&
static_cast<UnitImpl*>(cmd->unit)->lastImmediateCommand != *cmd )
{
cmd = commandOptimizer[i].erase(cmd);
continue;
}
}*/

// If we are starting a new command grouping
if ( groupOf12.empty() )
Expand Down
8 changes: 6 additions & 2 deletions bwapi/DevAIModule/Source/DevAIModule.cpp
Expand Up @@ -33,7 +33,7 @@ void DevAIModule::onStart()
//bw->setFrameSkip(16);

// set command optimization
bw->setCommandOptimizationLevel(3);
bw->setCommandOptimizationLevel(0);
}

void DevAIModule::onEnd(bool isWinner)
Expand All @@ -55,7 +55,11 @@ void DevAIModule::onFrame()
Unitset myUnits = bw->getSelectedUnits();
for ( auto &u : myUnits )
{
bw->drawTextMap(u->getPosition(), "%s %s %s", bools(u->isStartingAttack()), bools(u->isAttacking()), bools(u->isAttackFrame()));
if (!u->cloak())
{
bw->drawTextMap(u->getPosition(), "%s", bw->getLastError().c_str());
}

} // for
}
}
Expand Down

0 comments on commit 27bcd3c

Please sign in to comment.