-
Notifications
You must be signed in to change notification settings - Fork 124
bugfix(ocl): Fix GLA Rebel Ambush units spawning in water/cliffs and dying immediately #1882
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 |
|---|---|---|
|
|
@@ -1394,8 +1394,25 @@ class GenericObjectCreationNugget : public ObjectCreationNugget | |
| FindPositionOptions fpOptions; | ||
| fpOptions.minRadius = GameLogicRandomValueReal(m_minDistanceAFormation, m_minDistanceBFormation); | ||
| fpOptions.maxRadius = m_maxDistanceFormation; | ||
| #if !RETAIL_COMPATIBLE_CRC | ||
| // TheSuperHackers @bugfix bobtista 18/11/2025 Use FPF_CLEAR_CELLS_ONLY when DiesOnBadLand to prevent spawning in water/cliffs | ||
| if (m_diesOnBadLand) | ||
| { | ||
| fpOptions.flags = static_cast<FindPositionFlags>(FPF_USE_HIGHEST_LAYER | FPF_CLEAR_CELLS_ONLY); | ||
| } | ||
| else | ||
| { | ||
| fpOptions.flags = FPF_USE_HIGHEST_LAYER; | ||
| } | ||
| // TheSuperHackers @bugfix bobtista 18/11/2025 Fall back to center if no passable position found in spread formation | ||
| if (!ThePartitionManager->findPositionAround(pos, &fpOptions, &resultPos)) | ||
| { | ||
| resultPos = *pos; | ||
|
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. Was this branch ever taken in your testing?
Author
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 didn't set a breaktpoint to check, I just played a game against an easy computer with water and mountains and eventually did rebel ambushes on the water and mountains to see if anyone died. |
||
| } | ||
| #else | ||
| fpOptions.flags = FPF_USE_HIGHEST_LAYER; | ||
| ThePartitionManager->findPositionAround(pos, &fpOptions, &resultPos); | ||
| #endif | ||
| doStuffToObj( debris, m_names[pick], &resultPos, mtx, orientation, sourceObj, lifetimeFrames ); | ||
| } | ||
| else | ||
|
|
||
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.
Maybe it'd be better to combine both comments given their proximity.
Could be something like: