-
Notifications
You must be signed in to change notification settings - Fork 209
Fix skirmish AI buildability check passing wrong template (#2407) #2837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,7 +215,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) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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."); | ||
|
|
||
There was a problem hiding this comment.
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.