Skip to content

Commit a9388ab

Browse files
committed
bugfix: Use primary exit interface rally point in exit path
1 parent 83a51f8 commit a9388ab

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ void OpenContain::exitObjectViaDoor( Object *exitObj, ExitDoorType exitDoor )
925925
std::vector<Coord3D> exitPath;
926926
exitPath.push_back(endPosition);
927927
exitPath.push_back(endPosition); // Do it twice, in case units stack up due to brief flying. jba.
928-
if (m_rallyPointExists) {
929-
exitPath.push_back(m_rallyPoint);
928+
if (const Coord3D *rallyPoint = getRallyPoint()) {
929+
exitPath.push_back(*rallyPoint);
930930
}
931931

932932
if( ai )
@@ -1422,6 +1422,18 @@ const Coord3D *OpenContain::getRallyPoint() const
14221422
if (m_rallyPointExists)
14231423
return &m_rallyPoint;
14241424

1425+
#if !RETAIL_COMPATIBLE_CRC
1426+
// TheSuperHackers @bugfix arcticdolphin 02/03/2026 Use primary exit interface rally point if available.
1427+
if (getObject())
1428+
{
1429+
ExitInterface *primaryExit = getObject()->getObjectExitInterface();
1430+
if (primaryExit && primaryExit != static_cast<const ExitInterface *>(this))
1431+
{
1432+
return primaryExit->getRallyPoint();
1433+
}
1434+
}
1435+
#endif
1436+
14251437
return nullptr;
14261438
}
14271439

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,8 @@ void OpenContain::exitObjectViaDoor( Object *exitObj, ExitDoorType exitDoor )
10451045
std::vector<Coord3D> exitPath;
10461046
exitPath.push_back(endPosition);
10471047
exitPath.push_back(endPosition); // Do it twice, in case units stack up due to brief flying. jba.
1048-
if (m_rallyPointExists) {
1049-
exitPath.push_back(m_rallyPoint);
1048+
if (const Coord3D *rallyPoint = getRallyPoint()) {
1049+
exitPath.push_back(*rallyPoint);
10501050
}
10511051

10521052
if( ai )
@@ -1609,6 +1609,18 @@ const Coord3D *OpenContain::getRallyPoint() const
16091609
if (m_rallyPointExists)
16101610
return &m_rallyPoint;
16111611

1612+
#if !RETAIL_COMPATIBLE_CRC
1613+
// TheSuperHackers @bugfix arcticdolphin 02/03/2026 Use primary exit interface rally point if available.
1614+
if (getObject())
1615+
{
1616+
ExitInterface *primaryExit = getObject()->getObjectExitInterface();
1617+
if (primaryExit && primaryExit != static_cast<const ExitInterface *>(this))
1618+
{
1619+
return primaryExit->getRallyPoint();
1620+
}
1621+
}
1622+
#endif
1623+
16121624
return nullptr;
16131625
}
16141626

0 commit comments

Comments
 (0)