More debug code to find unit mismatch

This commit is contained in:
Mark Vejvoda 2010-05-29 09:04:22 +00:00
parent 9159d44b7a
commit badd795865
2 changed files with 8 additions and 2 deletions

View File

@ -487,7 +487,9 @@ std::string Faction::toString() const {
result += "thisFaction = " + intToStr(this->thisFaction) + "\n";
result += "control = " + intToStr(this->control) + "\n";
result += this->factionType->toString() + "\n";
if(this->factionType != NULL) {
result += this->factionType->toString() + "\n";
}
result += this->upgradeManager.toString() + "\n";

View File

@ -587,8 +587,12 @@ void UnitUpdater::updateProduce(Unit *unit){
unit->setCurrSkill(scStop);
produced= new Unit(world->getNextUnitId(), Vec2i(0), pct->getProducedUnit(), unit->getFaction(), world->getMap(), CardinalDir::NORTH);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] about to place unit for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,produced->toString().c_str());
//place unit creates the unit
if(!world->placeUnit(unit->getCenteredPos(), 10, produced)){
if(!world->placeUnit(unit->getCenteredPos(), 10, produced)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] COULD NOT PLACE UNIT for unitID [%d]\n",__FILE__,__FUNCTION__,__LINE__,produced->getId());
delete produced;
}
else{