Skip to content
Open
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
6 changes: 6 additions & 0 deletions Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,9 @@ Int AIPlayer::getPlayerSuperweaponValue(Coord3D *center, Int playerNdx, Real rad
// ------------------------------------------------------------------------------------------------
Bool AIPlayer::startTraining( WorkOrder *order, Bool busyOK, AsciiString teamName)
{
if( order->m_thing == nullptr )
return FALSE;

Object *factory = findFactory(order->m_thing, busyOK);
if( factory )
{
Expand Down Expand Up @@ -1297,6 +1300,9 @@ Bool AIPlayer::startTraining( WorkOrder *order, Bool busyOK, AsciiString teamNam
// ------------------------------------------------------------------------------------------------
Object *AIPlayer::findFactory(const ThingTemplate *thing, Bool busyOK)
{
if( thing == nullptr )
return nullptr;

Object *busyFactory = nullptr; // We prefer a factory that isn't busy.
for( BuildListInfo *info = m_player->getBuildList(); info; info = info->getNext() )
{
Expand Down
6 changes: 6 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,9 @@ Int AIPlayer::getPlayerSuperweaponValue(Coord3D *center, Int playerNdx, Real rad
// ------------------------------------------------------------------------------------------------
Bool AIPlayer::startTraining( WorkOrder *order, Bool busyOK, AsciiString teamName)
{
if( order->m_thing == nullptr )
return FALSE;

Object *factory = findFactory(order->m_thing, busyOK);
if( factory )
{
Expand Down Expand Up @@ -1417,6 +1420,9 @@ Bool AIPlayer::startTraining( WorkOrder *order, Bool busyOK, AsciiString teamNam
// ------------------------------------------------------------------------------------------------
Object *AIPlayer::findFactory(const ThingTemplate *thing, Bool busyOK)
{
if( thing == nullptr )
return nullptr;

Object *busyFactory = nullptr; // We prefer a factory that isn't busy.
for( BuildListInfo *info = m_player->getBuildList(); info; info = info->getNext() )
{
Expand Down
Loading