Skip to content

Commit ac14263

Browse files
committed
bugfix(contain): fix exit path logic to utilize primary exit interface rally point if available
Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
1 parent 83a51f8 commit ac14263

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,16 @@ 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 !RETAIL_COMPATIBLE_CRC
929+
// TheSuperHackers @bugfix arcticdolphin 02/03/2026 Use primary exit interface rally point if available.
930+
if (const Coord3D *rallyPoint = getRallyPoint()) {
931+
exitPath.push_back(*rallyPoint);
932+
}
933+
#else
928934
if (m_rallyPointExists) {
929935
exitPath.push_back(m_rallyPoint);
930936
}
937+
#endif
931938

932939
if( ai )
933940
{
@@ -1422,6 +1429,18 @@ const Coord3D *OpenContain::getRallyPoint() const
14221429
if (m_rallyPointExists)
14231430
return &m_rallyPoint;
14241431

1432+
#if !RETAIL_COMPATIBLE_CRC
1433+
// TheSuperHackers @bugfix arcticdolphin 02/03/2026 Use primary exit interface rally point if available.
1434+
if (getObject())
1435+
{
1436+
ExitInterface *primaryExit = getObject()->getObjectExitInterface();
1437+
if (primaryExit && primaryExit != static_cast<ExitInterface *>(const_cast<OpenContain *>(this)))
1438+
{
1439+
return primaryExit->getRallyPoint();
1440+
}
1441+
}
1442+
#endif
1443+
14251444
return nullptr;
14261445
}
14271446

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,9 +1045,16 @@ 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 !RETAIL_COMPATIBLE_CRC
1049+
// TheSuperHackers @bugfix arcticdolphin 02/03/2026 Use primary exit interface rally point if available.
1050+
if (const Coord3D *rallyPoint = getRallyPoint()) {
1051+
exitPath.push_back(*rallyPoint);
1052+
}
1053+
#else
10481054
if (m_rallyPointExists) {
10491055
exitPath.push_back(m_rallyPoint);
10501056
}
1057+
#endif
10511058

10521059
if( ai )
10531060
{
@@ -1609,6 +1616,18 @@ const Coord3D *OpenContain::getRallyPoint() const
16091616
if (m_rallyPointExists)
16101617
return &m_rallyPoint;
16111618

1619+
#if !RETAIL_COMPATIBLE_CRC
1620+
// TheSuperHackers @bugfix arcticdolphin 02/03/2026 Use primary exit interface rally point if available.
1621+
if (getObject())
1622+
{
1623+
ExitInterface *primaryExit = getObject()->getObjectExitInterface();
1624+
if (primaryExit && primaryExit != static_cast<ExitInterface *>(const_cast<OpenContain *>(this)))
1625+
{
1626+
return primaryExit->getRallyPoint();
1627+
}
1628+
}
1629+
#endif
1630+
16121631
return nullptr;
16131632
}
16141633

0 commit comments

Comments
 (0)