diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 80ef4b5b..41d2bf94 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -316,6 +316,8 @@ void UnitUpdater::updateBuild(Unit *unit){ unit->getCurrVector(), gameCamera->getPos()); } + + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,builtUnit->toString().c_str()); } else{ //if there are no free cells diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index 38939619..1b39fc51 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -382,11 +382,18 @@ void World::createUnit(const string &unitName, int factionIndex, const Vec2i &po if(factionIndexgetIndex() != factionIndex) { + throw runtime_error("faction->getIndex() != factionIndex"); + } + const FactionType* ft= faction->getType(); const UnitType* ut= ft->getUnitType(unitName); Unit* unit= new Unit(getNextUnitId(), pos, ut, faction, &map, CardinalDir::NORTH); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString().c_str()); + if(placeUnit(pos, generationArea, unit, true)){ unit->create(true); unit->born(); @@ -395,6 +402,8 @@ void World::createUnit(const string &unitName, int factionIndex, const Vec2i &po else{ throw runtime_error("Unit cant be placed"); } + + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString().c_str()); } else { @@ -672,6 +681,8 @@ void World::initUnits(){ if(unit->getType()->hasSkillClass(scBeBuilt)){ map.flatternTerrain(unit); } + + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString().c_str()); } } }