From a1c2ac774d09ba5866484716e50053ec144ca5c1 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sat, 7 Nov 2026 17:33:50 +0100 Subject: [PATCH 1/5] bugfix(pathfinder): Improve initialization of uninitialized variable in Pathfinder::tightenPathCallback. --- .../GameEngine/Include/GameLogic/AIPathfind.h | 2 + .../Include/GameLogic/TerrainLogic.h | 5 ++ .../Source/GameLogic/AI/AIPathfind.cpp | 38 +++++++- .../Source/GameLogic/Map/TerrainLogic.cpp | 88 +++++++++++++++++++ 4 files changed, 132 insertions(+), 1 deletion(-) diff --git a/Core/GameEngine/Include/GameLogic/AIPathfind.h b/Core/GameEngine/Include/GameLogic/AIPathfind.h index e654942cd32..67c84d05ee0 100644 --- a/Core/GameEngine/Include/GameLogic/AIPathfind.h +++ b/Core/GameEngine/Include/GameLogic/AIPathfind.h @@ -391,6 +391,8 @@ class Pathfinder : PathfindServicesInterface, public Snapshot #if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC public: Bool m_classifyFenceZeroInit; + UnsignedByte m_tightenPathSpecialInit; + Coord3D m_tightenPathSpecialInitCoords; #endif }; diff --git a/Core/GameEngine/Include/GameLogic/TerrainLogic.h b/Core/GameEngine/Include/GameLogic/TerrainLogic.h index 90dda7f2411..dac6678e8c8 100644 --- a/Core/GameEngine/Include/GameLogic/TerrainLogic.h +++ b/Core/GameEngine/Include/GameLogic/TerrainLogic.h @@ -205,6 +205,11 @@ class Bridge : public MemoryPoolObject void setBridgeObjectID( ObjectID id ) { m_bridgeInfo.bridgeObjectID = id; } void setTowerObjectID( ObjectID id, BridgeTowerType which ) { m_bridgeInfo.towerObjectID[ which ] = id; } +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +private: + Bool isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coord3D& out) const; +#endif + }; //------------------------------------------------------------------------------------------------- diff --git a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 1b16e444058..3107edc8570 100644 --- a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -227,6 +227,8 @@ void Pathfinder::reset() #if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC m_classifyFenceZeroInit = false; + m_tightenPathSpecialInit = 0; + m_tightenPathSpecialInitCoords.zero(); #endif } @@ -1496,12 +1498,30 @@ Bool Pathfinder::checkForAdjust(Object *obj, const LocomotorSet& locomotorSet, B if (obj->isKindOf(KINDOF_AIRCRAFT)) { adjustedPathExists = true; } else { +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC + m_tightenPathSpecialInit = groupDest != nullptr; +#endif + + /* + Bool pathExists = clientSafeQuickDoesPathExist(locomotorSet, obj->getPosition(), dest); + adjustedPathExists = clientSafeQuickDoesPathExist(locomotorSet, obj->getPosition(), &adjustDest); + if (!pathExists) { + if (clientSafeQuickDoesPathExist(locomotorSet, dest, &adjustDest)) { + adjustedPathExists = true; + } + } + //*/ + Bool pathExists = clientSafeQuickDoesPathExist( locomotorSet, obj->getPosition(), dest); if (!pathExists && clientSafeQuickDoesPathExist( locomotorSet, dest, &adjustDest)) { adjustedPathExists = true; } else { adjustedPathExists = clientSafeQuickDoesPathExist( locomotorSet, obj->getPosition(), &adjustDest); } + +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC + m_tightenPathSpecialInit = 0; +#endif } if ( adjustedPathExists ) { if (groupDest) { @@ -1647,6 +1667,10 @@ Bool Pathfinder::adjustDestination(Object *obj, const LocomotorSet& locomotorSet layer = TheTerrainLogic->getLayerForDestination(groupDest); } +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC + m_tightenPathSpecialInitCoords.zero(); +#endif + Int i = cell.x; Int j = cell.y; // Check the center cell @@ -4569,14 +4593,26 @@ void Pathfinder::tightenPath(Object *obj, const LocomotorSet& locomotorSet, Coor TightenPathStruct info; getRadiusAndCenter(obj, info.radius, info.center); - info.layer = TheTerrainLogic->getLayerForDestination(from); info.obj = obj; info.locomotorSet = &locomotorSet; info.foundNewDest = false; info.orgDestPos = *to; #if RETAIL_COMPATIBLE_CRC + +#if RTS_ZEROHOUR + m_tightenPathSpecialInit = 2; + info.layer = TheTerrainLogic->getLayerForDestination(from); + m_tightenPathSpecialInit = 0; + + info.newDestPos = m_tightenPathSpecialInitCoords; +#else + info.layer = TheTerrainLogic->getLayerForDestination(from); info.newDestPos.zero(); #endif + +#else + info.layer = TheTerrainLogic->getLayerForDestination(from); +#endif iterateCellsAlongLine(*from, *to, info.layer, tightenPathCallback, &info); if (info.foundNewDest) { *from = info.newDestPos; diff --git a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 863564360dc..5209d300c11 100644 --- a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -435,6 +435,14 @@ Bool Bridge::isPointOnBridge(const Coord3D *pLoc) if (pLoc->y < m_bounds.lo.y) return(false); if (pLoc->y > m_bounds.hi.y) return(false); +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC + Pathfinder& pathfinder = *TheAI->pathfinder(); + if (pathfinder.m_tightenPathSpecialInit) + { + return isPointOnBridge_internal(*pLoc, pathfinder.m_tightenPathSpecialInit == 2, pathfinder.m_tightenPathSpecialInitCoords); + } +#endif + Vector3 testPt(pLoc->x, pLoc->y, pLoc->z); Vector3 left1(m_bridgeInfo.fromLeft.x, m_bridgeInfo.fromLeft.y, m_bridgeInfo.fromLeft.z); Vector3 right1(m_bridgeInfo.fromRight.x, m_bridgeInfo.fromRight.y, m_bridgeInfo.fromRight.z); @@ -452,6 +460,86 @@ Bool Bridge::isPointOnBridge(const Coord3D *pLoc) return(false); } +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +Bool Bridge::isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coord3D& out) const +{ + const Vector3 testPt(pos.x, pos.y, pos.z); + const Vector3 left1(m_bridgeInfo.fromLeft.x, m_bridgeInfo.fromLeft.y, m_bridgeInfo.fromLeft.z); + const Vector3 right1(m_bridgeInfo.fromRight.x, m_bridgeInfo.fromRight.y, m_bridgeInfo.fromRight.z); + const Vector3 left2(m_bridgeInfo.toLeft.x, m_bridgeInfo.toLeft.y, m_bridgeInfo.toLeft.z); + const Vector3 right2(m_bridgeInfo.toRight.x, m_bridgeInfo.toRight.y, m_bridgeInfo.toRight.z); + + unsigned char flags; + + if (Point_In_Triangle_2D(left1, right1, left2, testPt, 0, 1, flags)) + { + if (specialInit) + { + const Vector3& tri_point0 = left1; + const Vector3& tri_point1 = right1; + + const Vector2 p0p1(tri_point1[0] - tri_point0[0], tri_point1[1] - tri_point0[1]); + const Vector2 p0pT(testPt[0] - tri_point0[0], testPt[1] - tri_point0[1]); + const float z = Vector2::Perp_Dot_Product(p0p1, p0pT); + + out.set(p0p1.X, p0p1.Y, z); + } + else + { + /* + Vector3 result; + Vector3::Cross_Product((right1 - left1), (left2 - left1), &result); + + const float length = result.Length2(); + const float y = std::bit_cast(std::bit_cast(length) - 0x800000); + + out.set(0.0f, y, 0.0f); + //*/ + + out.set(0.0f, 1000000000.0f, 0.0f); + } + + return true; + } + else + { + const bool inTriangle = Point_In_Triangle_2D(right1, left2, right2, testPt, 0, 1, flags); + + if (specialInit) + { + const Vector3& tri_point0 = right1; + const Vector3& tri_point1 = left2; + + const Vector2 p0p1(tri_point1[0] - tri_point0[0], tri_point1[1] - tri_point0[1]); + const Vector2 p0pT(testPt[0] - tri_point0[0], testPt[1] - tri_point0[1]); + const float z = Vector2::Perp_Dot_Product(p0p1, p0pT); + + out.set(p0p1.X, p0p1.Y, z); + } + else if (inTriangle) + { + /* + Vector3 result; + Vector3::Cross_Product((right1 - left1), (left2 - left1), &result); + + const float length = result.Length2(); + const float y = std::bit_cast(std::bit_cast(length) - 0x800000); + + out.set(0.0f, y, 0.0f); + //*/ + + out.set(0.0f, 1000000000.0f, 0.0f); + } + else + { + out.set(0.0f, 0.0f, 0.0f); + } + + return inTriangle; + } +} +#endif // RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC + /*------------------------------------------------------------------------------------------------- /** Clip a floating point line to the region provided. The source line runs from p1 to p2, and is clipped * using the clipRegion. From ab316fd2641c754a138bdef0bcf1abfbb820be9c Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Tue, 10 Nov 2026 02:43:59 +0100 Subject: [PATCH 2/5] Removed old code. --- .../Source/GameLogic/AI/AIPathfind.cpp | 10 ---------- .../Source/GameLogic/Map/TerrainLogic.cpp | 20 ------------------- 2 files changed, 30 deletions(-) diff --git a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 3107edc8570..dea72d23c99 100644 --- a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -1502,16 +1502,6 @@ Bool Pathfinder::checkForAdjust(Object *obj, const LocomotorSet& locomotorSet, B m_tightenPathSpecialInit = groupDest != nullptr; #endif - /* - Bool pathExists = clientSafeQuickDoesPathExist(locomotorSet, obj->getPosition(), dest); - adjustedPathExists = clientSafeQuickDoesPathExist(locomotorSet, obj->getPosition(), &adjustDest); - if (!pathExists) { - if (clientSafeQuickDoesPathExist(locomotorSet, dest, &adjustDest)) { - adjustedPathExists = true; - } - } - //*/ - Bool pathExists = clientSafeQuickDoesPathExist( locomotorSet, obj->getPosition(), dest); if (!pathExists && clientSafeQuickDoesPathExist( locomotorSet, dest, &adjustDest)) { adjustedPathExists = true; diff --git a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 5209d300c11..64010f00c23 100644 --- a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -486,16 +486,6 @@ Bool Bridge::isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coor } else { - /* - Vector3 result; - Vector3::Cross_Product((right1 - left1), (left2 - left1), &result); - - const float length = result.Length2(); - const float y = std::bit_cast(std::bit_cast(length) - 0x800000); - - out.set(0.0f, y, 0.0f); - //*/ - out.set(0.0f, 1000000000.0f, 0.0f); } @@ -518,16 +508,6 @@ Bool Bridge::isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coor } else if (inTriangle) { - /* - Vector3 result; - Vector3::Cross_Product((right1 - left1), (left2 - left1), &result); - - const float length = result.Length2(); - const float y = std::bit_cast(std::bit_cast(length) - 0x800000); - - out.set(0.0f, y, 0.0f); - //*/ - out.set(0.0f, 1000000000.0f, 0.0f); } else From 1ebcb5f3a5286529ba95947eb024509ffe9dac22 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Tue, 10 Nov 2026 21:14:08 +0100 Subject: [PATCH 3/5] Changed 'RETAIL_COMPATIBLE_CRC' to 'RETAIL_COMPATIBLE_PATHFINDING'. --- Core/GameEngine/Include/GameLogic/AIPathfind.h | 2 +- Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp | 4 ++-- .../Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/GameEngine/Include/GameLogic/AIPathfind.h b/Core/GameEngine/Include/GameLogic/AIPathfind.h index 67c84d05ee0..d13cbf90798 100644 --- a/Core/GameEngine/Include/GameLogic/AIPathfind.h +++ b/Core/GameEngine/Include/GameLogic/AIPathfind.h @@ -388,7 +388,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot Int m_queuePRTail; Int m_cumulativeCellsAllocated; -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING public: Bool m_classifyFenceZeroInit; UnsignedByte m_tightenPathSpecialInit; diff --git a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index dea72d23c99..fc6c180b324 100644 --- a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -225,7 +225,7 @@ void Pathfinder::reset() s_forceCleanCells = false; #endif -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING m_classifyFenceZeroInit = false; m_tightenPathSpecialInit = 0; m_tightenPathSpecialInitCoords.zero(); @@ -366,7 +366,7 @@ void Pathfinder::classifyFence( Object *obj, Bool insert ) cellBounds.lo.x = REAL_TO_INT_FLOOR((pos->x + 0.5f)/PATHFIND_CELL_SIZE_F); cellBounds.lo.y = REAL_TO_INT_FLOOR((pos->y + 0.5f)/PATHFIND_CELL_SIZE_F); // TheSuperHackers @fix Mauller 16/06/2025 Fixes uninitialized variables. -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_PATHFINDING //CRCDEBUG_LOG(("Pathfinder::classifyFence - (%d,%d)", cellBounds.hi.x, cellBounds.hi.y)); // For retail the values on the stack are often either 0 or larger than the map size. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 5dd5c761723..6f80e684773 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -2537,7 +2537,7 @@ void GameLogic::processDestroyList() { //USE_PERF_TIMER(processDestroyList) -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING // TheSuperHackers @info Set m_classifyFenceZeroInit to true for the first object. It's set to false when this function exits. // Pathfinder::classifyFence may be called indirectly from Object::~Object. TheAI->pathfinder()->m_classifyFenceZeroInit = !m_objectsToDestroy.empty(); @@ -2602,7 +2602,7 @@ void GameLogic::processDestroyList() Object::friend_deleteInstance(currentObject);//actual delete -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING TheAI->pathfinder()->m_classifyFenceZeroInit = false; #endif } From ec5c447e062fe41233b4a00d3d7b18784de2ad48 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Tue, 10 Nov 2026 21:21:10 +0100 Subject: [PATCH 4/5] Updated other instances of 'RETAIL_COMPATIBLE_CRC' to 'RETAIL_COMPATIBLE_PATHFINDING'. --- Core/GameEngine/Include/GameLogic/TerrainLogic.h | 2 +- Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp | 8 ++++---- Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Core/GameEngine/Include/GameLogic/TerrainLogic.h b/Core/GameEngine/Include/GameLogic/TerrainLogic.h index dac6678e8c8..45d325e69c3 100644 --- a/Core/GameEngine/Include/GameLogic/TerrainLogic.h +++ b/Core/GameEngine/Include/GameLogic/TerrainLogic.h @@ -205,7 +205,7 @@ class Bridge : public MemoryPoolObject void setBridgeObjectID( ObjectID id ) { m_bridgeInfo.bridgeObjectID = id; } void setTowerObjectID( ObjectID id, BridgeTowerType which ) { m_bridgeInfo.towerObjectID[ which ] = id; } -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING private: Bool isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coord3D& out) const; #endif diff --git a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index fc6c180b324..8a69e78f9d0 100644 --- a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -1498,7 +1498,7 @@ Bool Pathfinder::checkForAdjust(Object *obj, const LocomotorSet& locomotorSet, B if (obj->isKindOf(KINDOF_AIRCRAFT)) { adjustedPathExists = true; } else { -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING m_tightenPathSpecialInit = groupDest != nullptr; #endif @@ -1509,7 +1509,7 @@ Bool Pathfinder::checkForAdjust(Object *obj, const LocomotorSet& locomotorSet, B adjustedPathExists = clientSafeQuickDoesPathExist( locomotorSet, obj->getPosition(), &adjustDest); } -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING m_tightenPathSpecialInit = 0; #endif } @@ -1657,7 +1657,7 @@ Bool Pathfinder::adjustDestination(Object *obj, const LocomotorSet& locomotorSet layer = TheTerrainLogic->getLayerForDestination(groupDest); } -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING m_tightenPathSpecialInitCoords.zero(); #endif @@ -4587,7 +4587,7 @@ void Pathfinder::tightenPath(Object *obj, const LocomotorSet& locomotorSet, Coor info.locomotorSet = &locomotorSet; info.foundNewDest = false; info.orgDestPos = *to; -#if RETAIL_COMPATIBLE_CRC +#if RETAIL_COMPATIBLE_PATHFINDING #if RTS_ZEROHOUR m_tightenPathSpecialInit = 2; diff --git a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 64010f00c23..cd175b1161b 100644 --- a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -435,7 +435,7 @@ Bool Bridge::isPointOnBridge(const Coord3D *pLoc) if (pLoc->y < m_bounds.lo.y) return(false); if (pLoc->y > m_bounds.hi.y) return(false); -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING Pathfinder& pathfinder = *TheAI->pathfinder(); if (pathfinder.m_tightenPathSpecialInit) { @@ -460,7 +460,7 @@ Bool Bridge::isPointOnBridge(const Coord3D *pLoc) return(false); } -#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING Bool Bridge::isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coord3D& out) const { const Vector3 testPt(pos.x, pos.y, pos.z); @@ -518,7 +518,7 @@ Bool Bridge::isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coor return inTriangle; } } -#endif // RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC +#endif // RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING /*------------------------------------------------------------------------------------------------- /** Clip a floating point line to the region provided. The source line runs from p1 to p2, and is clipped From fe87ff36f5a0df1e1f862c948d4ef74c42d6ffc6 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Tue, 10 Nov 2026 21:30:26 +0100 Subject: [PATCH 5/5] Added comment. --- Core/GameEngine/Include/GameLogic/TerrainLogic.h | 2 +- Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/GameEngine/Include/GameLogic/TerrainLogic.h b/Core/GameEngine/Include/GameLogic/TerrainLogic.h index 45d325e69c3..5b005587cc2 100644 --- a/Core/GameEngine/Include/GameLogic/TerrainLogic.h +++ b/Core/GameEngine/Include/GameLogic/TerrainLogic.h @@ -207,7 +207,7 @@ class Bridge : public MemoryPoolObject #if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING private: - Bool isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coord3D& out) const; + Bool isPointOnBridge_SpecialInit(const Coord3D& pos, Bool specialInit, Coord3D& out) const; #endif }; diff --git a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index cd175b1161b..fb8985015f1 100644 --- a/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -439,7 +439,7 @@ Bool Bridge::isPointOnBridge(const Coord3D *pLoc) Pathfinder& pathfinder = *TheAI->pathfinder(); if (pathfinder.m_tightenPathSpecialInit) { - return isPointOnBridge_internal(*pLoc, pathfinder.m_tightenPathSpecialInit == 2, pathfinder.m_tightenPathSpecialInitCoords); + return isPointOnBridge_SpecialInit(*pLoc, pathfinder.m_tightenPathSpecialInit == 2, pathfinder.m_tightenPathSpecialInitCoords); } #endif @@ -461,7 +461,9 @@ Bool Bridge::isPointOnBridge(const Coord3D *pLoc) } #if RTS_ZEROHOUR && RETAIL_COMPATIBLE_PATHFINDING -Bool Bridge::isPointOnBridge_internal(const Coord3D& pos, Bool specialInit, Coord3D& out) const +// TheSuperHackers @info Caball009 11/11/2026 Special version of function Bridge::isPointOnBridge for retail compatibility. +// The purpose of this function is to get the values for the originally uninitialized variable in Pathfinder::tightenPathCallback. +Bool Bridge::isPointOnBridge_SpecialInit(const Coord3D& pos, Bool specialInit, Coord3D& out) const { const Vector3 testPt(pos.x, pos.y, pos.z); const Vector3 left1(m_bridgeInfo.fromLeft.x, m_bridgeInfo.fromLeft.y, m_bridgeInfo.fromLeft.z);