Skip to content

bugfix(ai): Prevent units from deploying when moving - #3016

Draft
Caball009 wants to merge 1 commit into
TheSuperHackers:mainfrom
Caball009:fix_object_deployment
Draft

bugfix(ai): Prevent units from deploying when moving#3016
Caball009 wants to merge 1 commit into
TheSuperHackers:mainfrom
Caball009:fix_object_deployment

Conversation

@Caball009

@Caball009 Caball009 commented Jul 26, 2026

Copy link
Copy Markdown

This PR prevents units from deploying when they're still moving. The issue is most notable with the Nuke Cannon, which deploys and fires just ahead reaching its goal position (see issue).

The pathfinding code uses Weapon::isGoalPosWithinAttackRange, while the deployment code uses isWithinAttackRange. The former uses a smaller range than strictly necessary, so that attacks don't fail all the time on moving targets. That's why units deploy just ahead of reaching their goal position.

#176 (comment)

This change assumes that unit movement and deployment are always mutually exclusive.

@Caball009 Caball009 added AI Is AI related Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Jul 26, 2026
@Caball009
Caball009 force-pushed the fix_object_deployment branch from 8d3ef76 to e3a6993 Compare July 26, 2026 19:56
@Caball009
Caball009 force-pushed the fix_object_deployment branch from e3a6993 to 7a918c9 Compare July 27, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Is AI related Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker NoRetail This fix or change is not applicable with Retail game compatibility ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

China Nuke Cannon can creep forward after firing

1 participant