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
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ void AISkirmishPlayer::processBaseBuilding()
}
continue;
}
if (TheBuildAssistant->canMakeUnit(dozer, bldgPlan)!=CANMAKE_OK) {
// TheSuperHackers @bugfix mohamedelabbas1996 Pass the current build-list

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment too long, maybe not even needed.
We don't reference to issues in code.

// entry (curPlan) to canMakeUnit, not the accumulated candidate (bldgPlan,
// which is still null here). Using bldgPlan made the buildability check fail
// for entries relying on AutomaticallyBuild=Yes (or the default when the
// field is omitted), so the AI never selected them. Fixes issue #2407.
if (TheBuildAssistant->canMakeUnit(dozer, curPlan)!=CANMAKE_OK) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may cause a mismatch when using an AI in multiplayer. Has this been tested?

If it can cause a mismatch, it needs to be behind RETAIL guards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect that is very likely.

if (info->isBuildable()) {
AsciiString bldgName = info->getTemplateName();
bldgName.concat(" - Dozer unable to build - money or technology missing.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ void AISkirmishPlayer::processBaseBuilding()
}
continue;
}
if (TheBuildAssistant->canMakeUnit(dozer, bldgPlan)!=CANMAKE_OK) {
// TheSuperHackers @bugfix mohamedelabbas1996 Pass the current build-list
// entry (curPlan) to canMakeUnit, not the accumulated candidate (bldgPlan,
// which is still null here). Using bldgPlan made the buildability check fail
// for entries relying on AutomaticallyBuild=Yes (or the default when the
// field is omitted), so the AI never selected them. Fixes issue #2407.
if (TheBuildAssistant->canMakeUnit(dozer, curPlan)!=CANMAKE_OK) {
if (info->isBuildable()) {
AsciiString bldgName = info->getTemplateName();
bldgName.concat(" - Dozer unable to build - money or technology missing.");
Expand Down
Loading