Skip to content

Commit

Permalink
Fix transport unload engine crash. #1319
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog committed Feb 24, 2024
1 parent cd8a245 commit 825c93d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rts/Sim/Units/CommandAI/MobileCAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,8 @@ bool CMobileCAI::FindEmptySpot(const CUnit* unloadee, const float3& center, floa
// radius is the size of the command unloading-zone (e.g. dragged by player);
// spread is the *minimum* distance between any pair of unloaded units which
// also has to respect radius
spread = std::clamp(spread, 1.0f * SQUARE_SIZE, radius);
radius = std::max(radius, static_cast<float>(SQUARE_SIZE));
spread = std::clamp(spread, static_cast<float>(SQUARE_SIZE), radius);

// more attempts for larger unloading zones
for (int a = 0; a < maxAttempts; ++a) {
Expand Down

0 comments on commit 825c93d

Please sign in to comment.