-
Notifications
You must be signed in to change notification settings - Fork 248
bugfix: Contact weapons are no longer blocked by obstacles #3194
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 |
|---|---|---|
|
|
@@ -3399,7 +3399,13 @@ void AIUpdateInterface::privateAttackPosition( const Coord3D *pos, Int maxShotsT | |
| // this fixes an obscure bug with mine-clearing: if you tell someone to clear mines and put the centerpoint | ||
| // inside a building, the dozer/worker will just go thru the building to that spot. ick. so if you find that | ||
| // this clause (below) is problematic, you'll probably have to find another way to fix this mine-clearing bug. (srj) | ||
| #if RETAIL_COMPATIBLE_CRC | ||
| if (weapon && weapon->isContactWeapon() && !isPathAvailable(&localPos)) | ||
| #else | ||
| // TheSuperHackers @bugfix Stubbjax 23/08/2026 Only find a new position if the target is not within the attack range of the weapon. | ||
| // This allows contact weapons such as suicide bombs to immediately detonate without first pathing to a nearby position. | ||
| if (weapon && weapon->isContactWeapon() && !weapon->isWithinAttackRange(getObject(), &localPos) && !isPathAvailable(&localPos)) | ||
| #endif | ||
|
Comment on lines
+3402
to
+3408
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. 3. Unpathable contact target preserved privateAttackPosition now skips the “find a nearby pathable spot” adjustment for contact weapons if isWithinAttackRange() is true, even when isPathAvailable() is false. Combined with the LOS bypass, this lets a unit execute a contact attack on an explicitly unpathable goal point (e.g., inside blocking geometry) as long as it can get within range outside the obstacle. Agent Prompt
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. What about this comment from the Ant Eater? |
||
| { | ||
| FindPositionOptions fpOptions; | ||
| fpOptions.minRadius = 0.0f; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.