Skip to content

Commit 242b20c

Browse files
committed
Change code at call site and remove pointer check at call site.
1 parent f39eaa1 commit 242b20c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,7 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg )
153153
for( info = m_player->getBuildList(); info; info = info->getNext() )
154154
{
155155
const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( info->getTemplateName() );
156-
if (!bldgPlan) {
157-
continue;
158-
}
159-
if (!bldgPlan->isEquivalentTo(bldg->getTemplate())) {
156+
if (!ThingTemplate::isEquivalentTo(bldgPlan, bldg->getTemplate())) {
160157
continue; // not the same kind of building we're looking for.
161158
}
162159
// check for hole.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void AISkirmishPlayer::processBaseBuilding( void )
244244
}
245245
}
246246
}
247-
if (powerPlan && powerInfo && !powerPlan->isEquivalentTo(bldgPlan)) {
247+
if (powerInfo && ThingTemplate::isEquivalentTo(powerPlan, bldgPlan)) {
248248
if (!powerUnderConstruction) {
249249
bldgPlan = powerPlan;
250250
bldgInfo = powerInfo;

0 commit comments

Comments
 (0)