Skip to content

Commit c528074

Browse files
committed
2 parents b9abae7 + 9b3d63f commit c528074

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,15 @@ Object *WorkerAIUpdate::construct( const ThingTemplate *what,
410410
obj->setPosition( pos );
411411
obj->setOrientation( angle );
412412

413-
// Flatten the terrain underneath the object, then adjust to the flattened height. jba.
414-
TheTerrainLogic->flattenTerrain(obj);
415-
Coord3D adjustedPos = *pos;
416-
adjustedPos.z = TheTerrainLogic->getGroundHeight(pos->x, pos->y);
417-
obj->setPosition(&adjustedPos);
413+
// Do not flatten shipyards
414+
if (!obj->isKindOf(KINDOF_SHIPYARD)) {
415+
416+
// Flatten the terrain underneath the object, then adjust to the flattened height. jba.
417+
TheTerrainLogic->flattenTerrain(obj);
418+
Coord3D adjustedPos = *pos;
419+
adjustedPos.z = TheTerrainLogic->getGroundHeight(pos->x, pos->y);
420+
obj->setPosition(&adjustedPos);
421+
}
418422

419423
// Note - very important that we add to map AFTER we flatten terrain. jba.
420424
TheAI->pathfinder()->addObjectToPathfindMap( obj );

0 commit comments

Comments
 (0)