- commented out what seems to be a bad assert / exception check

This commit is contained in:
Mark Vejvoda 2010-11-27 07:11:54 +00:00
parent 81d755cc83
commit 4e36b4c30c
1 changed files with 7 additions and 4 deletions

View File

@ -859,10 +859,13 @@ void Map::clearUnitCells(Unit *unit, const Vec2i &pos) {
}
if(ut->hasCellMap() == false || ut->getCellMapCell(i, j, unit->getModelFacing())) {
assert(getCell(currPos)->getUnit(unit->getCurrField())==unit);
if(getCell(currPos)->getUnit(unit->getCurrField()) != unit) {
throw runtime_error("getCell(currPos)->getUnit(unit->getCurrField()) != unit");
}
// This seems to be a bad assert since you can clear the cell
// for many reasons including a unit dieing.
//assert(getCell(currPos)->getUnit(unit->getCurrField())==unit);
//if(getCell(currPos)->getUnit(unit->getCurrField()) != unit) {
// throw runtime_error("getCell(currPos)->getUnit(unit->getCurrField()) != unit");
//}
getCell(currPos)->setUnit(unit->getCurrField(), NULL);