- 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

View File

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