- better error message on error

This commit is contained in:
Mark Vejvoda 2011-04-18 04:28:25 +00:00
parent 3617603fde
commit 762a612e33
1 changed files with 6 additions and 1 deletions

View File

@ -746,7 +746,12 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const {
CardinalDir facing;
// get facing/target ... the target might be dead due to lag, cope with it
if (ct->getClass() == ccBuild) {
assert(networkCommand->getTargetId() >= 0 && networkCommand->getTargetId() < 4);
//assert(networkCommand->getTargetId() >= 0 && networkCommand->getTargetId() < 4);
if(networkCommand->getTargetId() < 0 || networkCommand->getTargetId() >= 4) {
char szBuf[1024]="";
sprintf(szBuf,"networkCommand->getTargetId() >= 0 && networkCommand->getTargetId() < 4, [%s]",networkCommand->toString().c_str());
throw runtime_error(szBuf);
}
facing = CardinalDir(networkCommand->getTargetId());
}
else if (networkCommand->getTargetId() != Unit::invalidId ) {