Skip to content

Commit 3934164

Browse files
authored
build(ai): Resolve compile errors when the USE_DOZER preprocessor directive is false (#1871)
1 parent 6461ca5 commit 3934164

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ void AIPlayer::processBaseBuilding( void )
801801

802802
#else
803803
// force delay between rebuilds
804+
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
804805
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
805806
{
806807
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
@@ -815,7 +816,7 @@ void AIPlayer::processBaseBuilding( void )
815816
m_player->getMoney()->withdraw( cost );
816817

817818
// inst-construct the building
818-
bldg = buildStructureNow(bldgPlan, info, NULL);
819+
bldg = buildStructureNow(bldgPlan, info);
819820
// store the object with the build order
820821
if (bldg)
821822
{

Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ void AISkirmishPlayer::processBaseBuilding( void )
262262

263263
#else
264264
// force delay between rebuilds
265+
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
265266
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
266267
{
267268
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
@@ -276,12 +277,12 @@ void AISkirmishPlayer::processBaseBuilding( void )
276277
m_player->getMoney()->withdraw( cost );
277278

278279
// inst-construct the building
279-
bldg = buildStructureNow(bldgPlan, info, NULL);
280+
bldg = buildStructureNow(bldgPlan, bldgInfo);
280281
// store the object with the build order
281282
if (bldg)
282283
{
283-
info->setObjectID( bldg->getID() );
284-
info->decrementNumRebuilds();
284+
bldgInfo->setObjectID( bldg->getID() );
285+
bldgInfo->decrementNumRebuilds();
285286

286287
m_readyToBuildStructure = false;
287288
m_structureTimer = TheAI->getAiData()->m_structureSeconds*LOGICFRAMES_PER_SECOND;
@@ -291,8 +292,6 @@ void AISkirmishPlayer::processBaseBuilding( void )
291292
m_structureTimer = m_structureTimer/TheAI->getAiData()->m_structuresWealthyMod;
292293
}
293294
m_frameLastBuildingBuilt = TheGameLogic->getFrame();
294-
// only build one building per delay loop
295-
break;
296295
}
297296
}
298297
}

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ void AIPlayer::processBaseBuilding( void )
808808

809809
#else
810810
// force delay between rebuilds
811+
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
811812
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
812813
{
813814
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
@@ -822,7 +823,7 @@ void AIPlayer::processBaseBuilding( void )
822823
m_player->getMoney()->withdraw( cost );
823824

824825
// inst-construct the building
825-
bldg = buildStructureNow(bldgPlan, info, NULL);
826+
bldg = buildStructureNow(bldgPlan, info);
826827
// store the object with the build order
827828
if (bldg)
828829
{

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ void AISkirmishPlayer::processBaseBuilding( void )
269269

270270
#else
271271
// force delay between rebuilds
272+
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
272273
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
273274
{
274275
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
@@ -283,12 +284,12 @@ void AISkirmishPlayer::processBaseBuilding( void )
283284
m_player->getMoney()->withdraw( cost );
284285

285286
// inst-construct the building
286-
bldg = buildStructureNow(bldgPlan, info, NULL);
287+
bldg = buildStructureNow(bldgPlan, bldgInfo);
287288
// store the object with the build order
288289
if (bldg)
289290
{
290-
info->setObjectID( bldg->getID() );
291-
info->decrementNumRebuilds();
291+
bldgInfo->setObjectID( bldg->getID() );
292+
bldgInfo->decrementNumRebuilds();
292293

293294
m_readyToBuildStructure = false;
294295
m_structureTimer = TheAI->getAiData()->m_structureSeconds*LOGICFRAMES_PER_SECOND;
@@ -298,8 +299,6 @@ void AISkirmishPlayer::processBaseBuilding( void )
298299
m_structureTimer = m_structureTimer/TheAI->getAiData()->m_structuresWealthyMod;
299300
}
300301
m_frameLastBuildingBuilt = TheGameLogic->getFrame();
301-
// only build one building per delay loop
302-
break;
303302
}
304303
}
305304
}

0 commit comments

Comments
 (0)