Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ void AIPlayer::processBaseBuilding( void )

#else
// force delay between rebuilds
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
{
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
Expand All @@ -815,7 +816,7 @@ void AIPlayer::processBaseBuilding( void )
m_player->getMoney()->withdraw( cost );

// inst-construct the building
bldg = buildStructureNow(bldgPlan, info, NULL);
bldg = buildStructureNow(bldgPlan, info);
// store the object with the build order
if (bldg)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void AISkirmishPlayer::processBaseBuilding( void )

#else
// force delay between rebuilds
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
{
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
Expand All @@ -276,12 +277,12 @@ void AISkirmishPlayer::processBaseBuilding( void )
m_player->getMoney()->withdraw( cost );

// inst-construct the building
bldg = buildStructureNow(bldgPlan, info, NULL);
bldg = buildStructureNow(bldgPlan, bldgInfo);
// store the object with the build order
if (bldg)
{
info->setObjectID( bldg->getID() );
info->decrementNumRebuilds();
bldgInfo->setObjectID( bldg->getID() );
bldgInfo->decrementNumRebuilds();

m_readyToBuildStructure = false;
m_structureTimer = TheAI->getAiData()->m_structureSeconds*LOGICFRAMES_PER_SECOND;
Expand All @@ -291,8 +292,6 @@ void AISkirmishPlayer::processBaseBuilding( void )
m_structureTimer = m_structureTimer/TheAI->getAiData()->m_structuresWealthyMod;
}
m_frameLastBuildingBuilt = TheGameLogic->getFrame();
// only build one building per delay loop
break;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ void AIPlayer::processBaseBuilding( void )

#else
// force delay between rebuilds
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
{
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
Expand All @@ -822,7 +823,7 @@ void AIPlayer::processBaseBuilding( void )
m_player->getMoney()->withdraw( cost );

// inst-construct the building
bldg = buildStructureNow(bldgPlan, info, NULL);
bldg = buildStructureNow(bldgPlan, info);
// store the object with the build order
if (bldg)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ void AISkirmishPlayer::processBaseBuilding( void )

#else
// force delay between rebuilds
Int framesToBuild = bldgPlan->calcTimeToBuild(m_player);
if (TheGameLogic->getFrame() - m_frameLastBuildingBuilt < framesToBuild)
{
m_buildDelay = framesToBuild - (TheGameLogic->getFrame() - m_frameLastBuildingBuilt);
Expand All @@ -283,12 +284,12 @@ void AISkirmishPlayer::processBaseBuilding( void )
m_player->getMoney()->withdraw( cost );

// inst-construct the building
bldg = buildStructureNow(bldgPlan, info, NULL);
bldg = buildStructureNow(bldgPlan, bldgInfo);
// store the object with the build order
if (bldg)
{
info->setObjectID( bldg->getID() );
info->decrementNumRebuilds();
bldgInfo->setObjectID( bldg->getID() );
bldgInfo->decrementNumRebuilds();

m_readyToBuildStructure = false;
m_structureTimer = TheAI->getAiData()->m_structureSeconds*LOGICFRAMES_PER_SECOND;
Expand All @@ -298,8 +299,6 @@ void AISkirmishPlayer::processBaseBuilding( void )
m_structureTimer = m_structureTimer/TheAI->getAiData()->m_structuresWealthyMod;
}
m_frameLastBuildingBuilt = TheGameLogic->getFrame();
// only build one building per delay loop
break;
}
}
}
Expand Down
Loading