- added map cell checks back but output to error log only (and assert for debug mode)
This commit is contained in:
parent
128b98b619
commit
ab966d7872
|
@ -822,10 +822,11 @@ void Map::putUnitCells(Unit *unit, const Vec2i &pos) {
|
|||
if( ut->hasCellMap() == false || ut->getCellMapCell(i, j, unit->getModelFacing())) {
|
||||
// NOT SURE UNDER WHAT CONDITIONS THIS COULD HAPPEN?
|
||||
|
||||
//assert(getCell(currPos)->getUnit(unit->getCurrField()) == NULL);
|
||||
//if(getCell(currPos)->getUnit(unit->getCurrField()) != NULL) {
|
||||
assert(getCell(currPos)->getUnit(unit->getCurrField()) == NULL);
|
||||
if(getCell(currPos)->getUnit(unit->getCurrField()) != NULL) {
|
||||
// throw runtime_error("getCell(currPos)->getUnit(unit->getCurrField()) != NULL");
|
||||
//}
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] ERROR [getCell(currPos)->getUnit(unit->getCurrField()) != NULL] currPos [%s] unit [%s] cell unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,currPos.getString().c_str(),unit->toString().c_str(),getCell(currPos)->getUnit(unit->getCurrField())->toString().c_str());
|
||||
}
|
||||
|
||||
getCell(currPos)->setUnit(unit->getCurrField(), unit);
|
||||
|
||||
|
@ -864,10 +865,11 @@ void Map::clearUnitCells(Unit *unit, const Vec2i &pos) {
|
|||
// 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) {
|
||||
assert(getCell(currPos)->getUnit(unit->getCurrField())==unit);
|
||||
if(getCell(currPos)->getUnit(unit->getCurrField()) != unit) {
|
||||
// throw runtime_error("getCell(currPos)->getUnit(unit->getCurrField()) != unit");
|
||||
//}
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] ERROR [getCell(currPos)->getUnit(unit->getCurrField()) != unit] currPos [%s] unit [%s] cell unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,currPos.getString().c_str(),unit->toString().c_str(),(getCell(currPos)->getUnit(unit->getCurrField()) != NULL ? getCell(currPos)->getUnit(unit->getCurrField())->toString().c_str() : "NULL"));
|
||||
}
|
||||
|
||||
getCell(currPos)->setUnit(unit->getCurrField(), NULL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue