re-fix titi's morph when no space available
This commit is contained in:
parent
c9c5d9aa8f
commit
aceb9aec0a
|
@ -1332,7 +1332,7 @@ void Map::putUnitCellsPrivate(Unit *unit, const Vec2i &pos, const UnitType *ut,
|
|||
// }
|
||||
}
|
||||
|
||||
if(canPutInCell == true) {
|
||||
|
||||
if(getCell(currPos)->getUnit(field) == NULL ||
|
||||
getCell(currPos)->getUnit(field) == unit) {
|
||||
if(isMorph) {
|
||||
|
@ -1344,13 +1344,12 @@ void Map::putUnitCellsPrivate(Unit *unit, const Vec2i &pos, const UnitType *ut,
|
|||
getCell(currPos)->setUnit(unit->getCurrField(), unit);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if(canPutInCell == true) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"Trying to move unit [%d - %s] into occupied cell [%s] and field = %d, unit already in cell [%d - %s] ",unit->getId(),unit->getType()->getName(false).c_str(),pos.getString().c_str(),field,getCell(currPos)->getUnit(field)->getId(),getCell(currPos)->getUnit(field)->getType()->getName(false).c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(ut->hasCellMap() == true &&
|
||||
ut->getAllowEmptyCellMap() == true &&
|
||||
ut->hasEmptyCellMap() == true) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user