From 532de2e61c788e3861be1e6341c9ce6fbb1d1af5 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 18 Nov 2025 20:55:29 -0500 Subject: [PATCH 1/3] bugfix(ocl): Fix GLA Rebel Ambush units spawning in water/cliffs and dying immediately --- .../GameLogic/Object/ObjectCreationList.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index 3e6d515983..e8c0edfb27 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -1394,8 +1394,20 @@ class GenericObjectCreationNugget : public ObjectCreationNugget FindPositionOptions fpOptions; fpOptions.minRadius = GameLogicRandomValueReal(m_minDistanceAFormation, m_minDistanceBFormation); fpOptions.maxRadius = m_maxDistanceFormation; - fpOptions.flags = FPF_USE_HIGHEST_LAYER; - ThePartitionManager->findPositionAround(pos, &fpOptions, &resultPos); + // TheSuperHackers @bugfix bobtista 18/11/2025 Use FPF_CLEAR_CELLS_ONLY when DiesOnBadLand to prevent spawning in water/cliffs + if (m_diesOnBadLand) + { + fpOptions.flags = 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; + } doStuffToObj( debris, m_names[pick], &resultPos, mtx, orientation, sourceObj, lifetimeFrames ); } else From c80b0262131442c65802e4aadea0575ea8e606a9 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 18 Nov 2025 20:57:15 -0500 Subject: [PATCH 2/3] put behind retail compatible crc flag --- .../Source/GameLogic/Object/ObjectCreationList.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index e8c0edfb27..8e0b4001b0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -1394,6 +1394,7 @@ 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) { @@ -1408,6 +1409,10 @@ class GenericObjectCreationNugget : public ObjectCreationNugget { resultPos = *pos; } +#else + fpOptions.flags = FPF_USE_HIGHEST_LAYER; + ThePartitionManager->findPositionAround(pos, &fpOptions, &resultPos); +#endif doStuffToObj( debris, m_names[pick], &resultPos, mtx, orientation, sourceObj, lifetimeFrames ); } else From 80aff0da428adc279fe1363a9690e6c6b2d04e65 Mon Sep 17 00:00:00 2001 From: bobtista Date: Sat, 29 Nov 2025 15:15:18 -0500 Subject: [PATCH 3/3] fix(ocl): Add static_cast for FindPositionFlags bitwise OR --- .../GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index 8e0b4001b0..599e05eb8b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -1398,7 +1398,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget // TheSuperHackers @bugfix bobtista 18/11/2025 Use FPF_CLEAR_CELLS_ONLY when DiesOnBadLand to prevent spawning in water/cliffs if (m_diesOnBadLand) { - fpOptions.flags = FPF_USE_HIGHEST_LAYER | FPF_CLEAR_CELLS_ONLY; + fpOptions.flags = static_cast(FPF_USE_HIGHEST_LAYER | FPF_CLEAR_CELLS_ONLY); } else {