Skip to content

Commit ee4539d

Browse files
committed
bugfix: Units located above the terrain can no longer teleport into airborne transports
1 parent 5b5a973 commit ee4539d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6135,7 +6135,12 @@ StateReturnType AIEnterState::update()
61356135
StateReturnType code = AIInternalMoveToState::update();
61366136

61376137
// if it's airborne, wait for it to land
6138+
#if RETAIL_COMPATIBLE_CRC
61386139
if (code == STATE_SUCCESS && goal->isAboveTerrain() && !obj->isAboveTerrain())
6140+
#else
6141+
if (code == STATE_SUCCESS && (goal->getPosition()->z + goal->getGeometryInfo().getMaxHeightAbovePosition() < obj->getPosition()->z ||
6142+
goal->getPosition()->z > obj->getPosition()->z + obj->getGeometryInfo().getMaxHeightAbovePosition()))
6143+
#endif
61396144
{
61406145
code = STATE_CONTINUE;
61416146
}

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6347,7 +6347,12 @@ StateReturnType AIEnterState::update()
63476347
StateReturnType code = AIInternalMoveToState::update();
63486348

63496349
// if it's airborne, wait for it to land
6350+
#if RETAIL_COMPATIBLE_CRC
63506351
if (code == STATE_SUCCESS && goal->isAboveTerrain() && !obj->isAboveTerrain())
6352+
#else
6353+
if (code == STATE_SUCCESS && (goal->getPosition()->z + goal->getGeometryInfo().getMaxHeightAbovePosition() < obj->getPosition()->z ||
6354+
goal->getPosition()->z > obj->getPosition()->z + obj->getGeometryInfo().getMaxHeightAbovePosition()))
6355+
#endif
63516356
{
63526357
code = STATE_CONTINUE;
63536358
}

0 commit comments

Comments
 (0)