@@ -1250,7 +1250,7 @@ bool AICastor::addProject(Project *project)
12501250{
12511251 if (buildingSum[project->shortTypeNum ][0 ]>=project->amount )
12521252 {
1253- fprintf (logFile, " will not add project (%s x%d) as it already succeded \n " , project->debugName , project->amount );
1253+ fprintf (logFile, " will not add project (%s x%d) as it already succeeded \n " , project->debugName , project->amount );
12541254 delete project;
12551255 return false ;
12561256 }
@@ -1281,8 +1281,8 @@ bool AICastor::addProject(Project *project)
12811281
12821282void AICastor::addProjects ()
12831283{
1284- // printf(" canFeedUnit=%d, swarms=%d, pool=%d+%d, attaque =%d+%d, speed=%d+%d\n",
1285- // canFeedUnit, swarms, pool, poolSite, attaque, attaqueSite , speed, speedSite);
1284+ // printf(" canFeedUnit=%d, swarms=%d, pool=%d+%d, attack =%d+%d, speed=%d+%d\n",
1285+ // canFeedUnit, swarms, pool, poolSite, attack, attackSite , speed, speedSite);
12861286
12871287 buildsAmount=-1 ;
12881288
@@ -1376,7 +1376,7 @@ void AICastor::addProjects()
13761376 if (addProject(project))
13771377 return;
13781378 }*/
1379- // all critical projects succeded .
1379+ // all critical projects succeeded .
13801380
13811381 // enough workers
13821382 // Strategy::Builds buildsCurrent=strategy.buildsBase;
@@ -1492,7 +1492,7 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
14921492 {
14931493 // boot phase
14941494 project->subPhase =2 ;
1495- fprintf (logFile, " (%s) (boot) (switching to subphase 2)\n " , project->debugName );
1495+ fprintf (logFile, " (%s) (boot) (switching to sub-phase 2)\n " , project->debugName );
14961496 }
14971497 else if (project->subPhase ==1 )
14981498 {
@@ -1518,9 +1518,9 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
15181518 computeWorkRangeMap ();
15191519 computeWorkAbilityMap ();
15201520
1521- boost::shared_ptr<Order>gfbm =findGoodBuilding (typeNum, project->food , project->defense , project->critical );
1521+ boost::shared_ptr<Order>gFbm =findGoodBuilding (typeNum, project->food , project->defense , project->critical );
15221522 project->timer =timer;
1523- if (gfbm )
1523+ if (gFbm )
15241524 {
15251525 if (project->successWait >0 )
15261526 {
@@ -1530,8 +1530,8 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
15301530 else
15311531 {
15321532 project->subPhase =2 ;
1533- fprintf (logFile, " (%s) (one construction site placed) (switching to next subphase 2)\n " , project->debugName );
1534- return gfbm ;
1533+ fprintf (logFile, " (%s) (one construction site placed) (switching to next sub-phase 2)\n " , project->debugName );
1534+ return gFbm ;
15351535 }
15361536 }
15371537 else if (project->triesLeft >0 )
@@ -1557,29 +1557,29 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
15571557 if (real>=project->amount )
15581558 {
15591559 project->subPhase =6 ;
1560- fprintf (logFile, " (%s) ([%d>=%d] building finished) (switching to subphase 6).\n " ,
1560+ fprintf (logFile, " (%s) ([%d>=%d] building finished) (switching to sub-phase 6).\n " ,
15611561 project->debugName , real, project->amount );
15621562 if (!project->waitFinished )
15631563 {
1564- fprintf (logFile, " (%s) (deblocking [%d, %d])\n " , project->debugName , project->blocking , project->critical );
1564+ fprintf (logFile, " (%s) (de-blocking [%d, %d])\n " , project->debugName , project->blocking , project->critical );
15651565 project->blocking =false ;
15661566 project->critical =false ;
15671567 }
15681568 }
15691569 else if (sum<project->amount )
15701570 {
15711571 project->subPhase =1 ;
1572- fprintf (logFile, " (%s) (need more construction site [%d+%d<%d]) (switching back to subphase 1)\n " ,
1572+ fprintf (logFile, " (%s) (need more construction site [%d+%d<%d]) (switching back to sub-phase 1)\n " ,
15731573 project->debugName , real, site, project->amount );
15741574 }
15751575 else
15761576 {
15771577 project->subPhase =3 ;
1578- fprintf (logFile, " (%s) (enough real building site found [%d+%d>=%d]) (switching to next subphase 3)\n " ,
1578+ fprintf (logFile, " (%s) (enough real building site found [%d+%d>=%d]) (switching to next sub-phase 3)\n " ,
15791579 project->debugName , real, site, project->amount );
15801580 if (!project->waitFinished )
15811581 {
1582- fprintf (logFile, " (%s) (deblocking [%d, %d])\n " , project->debugName , project->blocking , project->critical );
1582+ fprintf (logFile, " (%s) (de-blocking [%d, %d])\n " , project->debugName , project->blocking , project->critical );
15831583 project->blocking =false ;
15841584 project->critical =false ;
15851585 }
@@ -1677,13 +1677,13 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
16771677 if (real>=project->amount )
16781678 {
16791679 project->subPhase =6 ;
1680- fprintf (logFile, " (%s) (building finished [%d+%d>=%d]) (switching to subphase 6).\n " ,
1680+ fprintf (logFile, " (%s) (building finished [%d+%d>=%d]) (switching to sub-phase 6).\n " ,
16811681 project->debugName , real, site, project->amount );
16821682 }
16831683 else if (sum<project->amount )
16841684 {
16851685 project->subPhase =1 ;
1686- fprintf (logFile, " (%s) (need more construction site [%d+%d<%d]) (switching back to subphase 1)\n " ,
1686+ fprintf (logFile, " (%s) (need more construction site [%d+%d<%d]) (switching back to sub-phase 1)\n " ,
16871687 project->debugName , real, site, project->amount );
16881688 }
16891689 else if (project->multipleStart )
@@ -1693,18 +1693,18 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
16931693 if (isFree>1 )
16941694 {
16951695 project->subPhase =1 ;
1696- fprintf (logFile, " (%s) (enough free workers %d) (switching back to subphase 1)\n " , project->debugName , isFree);
1696+ fprintf (logFile, " (%s) (enough free workers %d) (switching back to sub-phase 1)\n " , project->debugName , isFree);
16971697 }
16981698 else
16991699 {
17001700 project->subPhase =5 ;
1701- fprintf (logFile, " (%s) (no more free workers) (switching to next subphase 5)\n " , project->debugName );
1701+ fprintf (logFile, " (%s) (no more free workers) (switching to next sub-phase 5)\n " , project->debugName );
17021702 }
17031703 }
17041704 else
17051705 {
17061706 project->subPhase =5 ;
1707- fprintf (logFile, " (%s) (enough construction site [%d+%d>=%d]) (switching to next subphase 5)\n " ,
1707+ fprintf (logFile, " (%s) (enough construction site [%d+%d>=%d]) (switching to next sub-phase 5)\n " ,
17081708 project->debugName , real, site, project->amount );
17091709 }
17101710 }
@@ -1739,13 +1739,13 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
17391739 if (real>=project->amount )
17401740 {
17411741 project->subPhase =6 ;
1742- fprintf (logFile, " (%s) (building finished [%d+%d>=%d]) (switching to subphase 6).\n " ,
1742+ fprintf (logFile, " (%s) (building finished [%d+%d>=%d]) (switching to sub-phase 6).\n " ,
17431743 project->debugName , real, site, project->amount );
17441744 }
17451745 else if (sum<project->amount )
17461746 {
17471747 project->subPhase =2 ;
1748- fprintf (logFile, " (%s) (building destroyed! [%d+%d<%d]) (switching to subphase 2).\n " ,
1748+ fprintf (logFile, " (%s) (building destroyed! [%d+%d<%d]) (switching to sub-phase 2).\n " ,
17491749 project->debugName , real, site, project->amount );
17501750 }
17511751 }
@@ -1755,7 +1755,7 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
17551755
17561756 if (project->blocking )
17571757 {
1758- fprintf (logFile, " (%s) (deblocking [%d, %d])\n " , project->debugName , project->blocking , project->critical );
1758+ fprintf (logFile, " (%s) (de-blocking [%d, %d])\n " , project->debugName , project->blocking , project->critical );
17591759 project->blocking =false ;
17601760 project->critical =false ;
17611761 }
@@ -1784,7 +1784,7 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
17841784 if (buildingSum[project->shortTypeNum ][1 ]==0 )
17851785 {
17861786 project->finished =true ;
1787- fprintf (logFile, " (%s) (all finalWorkers set) (project succeded )\n " , project->debugName );
1787+ fprintf (logFile, " (%s) (all finalWorkers set) (project succeeded )\n " , project->debugName );
17881788 }
17891789 }
17901790 else
@@ -1834,8 +1834,8 @@ bool AICastor::enoughFreeWorkers()
18341834void AICastor::computeCanSwim ()
18351835{
18361836 // printf("computeCanSwim()...\n");
1837- // If our population has more healthy-working-units able to swimm than healthy-working-units
1838- // unable to swimm then we choose to be able to go trough water:
1837+ // If our population has more healthy-working-units able to swim than healthy-working-units
1838+ // unable to swim then we choose to be able to go trough water:
18391839 Unit **myUnits=team->myUnits ;
18401840 int sumCanSwim=0 ;
18411841 int sumCantSwim=0 ;
@@ -2016,7 +2016,7 @@ void AICastor::computeObstacleUnitMap()
20162016 obstacleUnitMap[i]=0 ;
20172017 else if (c.forbidden &teamMask)
20182018 obstacleUnitMap[i]=0 ;
2019- else if (!canSwim && (c.terrain >=256 ) && (c.terrain <256 +16 )) // !canSwim && isWatter ?
2019+ else if (!canSwim && (c.terrain >=256 ) && (c.terrain <256 +16 )) // !canSwim && isWater ?
20202020 obstacleUnitMap[i]=0 ;
20212021 else
20222022 obstacleUnitMap[i]=1 ;
@@ -2106,7 +2106,7 @@ void AICastor::computeBuildingNeighbourMapOfBuilding(int bx, int by, int bw, int
21062106 Uint8 *gradient=buildingNeighbourMap;
21072107 const auto & tiles=map->tiles ;
21082108
2109- // Uint8 *wheatGradient=map->ressourcesGradient [team->teamNumber][CORN][canSwim];
2109+ // Uint8 *wheatGradient=map->resourcesGradient [team->teamNumber][CORN][canSwim];
21102110
21112111 /* int bx=b->posX;
21122112 int by=b->posY;
@@ -2514,7 +2514,7 @@ void AICastor::computeWheatCareMap()
25142514 // int wDec=map->wDec;
25152515 size_t size=w*h;
25162516 size_t sizeMask=(size-1 );
2517- // Uint8 *wheatGradient=map->ressourcesGradient [team->teamNumber][CORN][canSwim];
2517+ // Uint8 *wheatGradient=map->resourcesGradient [team->teamNumber][CORN][canSwim];
25182518 // Tile *tiles=map->tiles;
25192519 // Uint32 teamMask=team->me;
25202520
@@ -2925,7 +2925,7 @@ void AICastor::computeResourcesCluster()
29252925 {
29262926 const auto & c = map->tiles [map->coordToIndex (x, y)]; // case
29272927 const auto & r=c.resource ; // resource
2928- Uint8 rt=r.type ; // ressources type
2928+ Uint8 rt=r.type ; // resources type
29292929
29302930 int rci=x+y*w; // resource cluster index
29312931 Uint16 *rcp=&resourcesCluster[rci]; // resource cluster pointer
@@ -2959,13 +2959,13 @@ void AICastor::computeResourcesCluster()
29592959 }
29602960 else
29612961 {
2962- Uint16 oldid =id;
2963- usedId[oldid ]=false ;
2962+ Uint16 oldId =id;
2963+ usedId[oldId ]=false ;
29642964 id=rc; // newid
2965- fprintf (logFile, " cleaning oldid =%d to id=%d.\n " , oldid , id);
2965+ fprintf (logFile, " cleaning oldId =%d to id=%d.\n " , oldId , id);
29662966 // We have to correct last resourcesCluster values:
29672967 *rcp=id;
2968- while (*rcp==oldid )
2968+ while (*rcp==oldId )
29692969 {
29702970 *rcp=id;
29712971 rcp--;
0 commit comments