Skip to content

Commit 1559334

Browse files
authored
tweak: Return shrouded status for shrouded exit extents
1 parent db7f4d4 commit 1559334

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -873,26 +873,31 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos
873873

874874
// an immobile object will obstruct our building no matter what team it's on
875875
if ( them->isKindOf( KINDOF_IMMOBILE ) ) {
876-
Bool shrouded = them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud();
877876
/* Check for overlap of my exit rectangle to his geom info. */
878877
if (checkMyExit && ThePartitionManager->geomCollidesWithGeom(them->getPosition(), hisBounds, them->getOrientation(),
879878
&myExitPos, myGeom, angle)) {
880-
if (!shrouded)
881-
TheTerrainVisual->addFactionBib(them, true);
879+
if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud())
880+
return LBC_SHROUD;
881+
882+
TheTerrainVisual->addFactionBib(them, true);
882883
return LBC_OBJECTS_IN_THE_WAY;
883884
}
884885
// Check for overlap of his exit rectangle with my geom info
885886
if (checkHisExit && ThePartitionManager->geomCollidesWithGeom(&hisExitPos, hisGeom, them->getOrientation(),
886887
worldPos, myBounds, angle)) {
887-
if (!shrouded)
888-
TheTerrainVisual->addFactionBib(them, true);
888+
if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud())
889+
return LBC_SHROUD;
890+
891+
TheTerrainVisual->addFactionBib(them, true);
889892
return LBC_OBJECTS_IN_THE_WAY;
890893
}
891894
// Check both exit rectangles together.
892895
if (checkMyExit&&checkHisExit&&ThePartitionManager->geomCollidesWithGeom(&hisExitPos, hisGeom, them->getOrientation(),
893896
&myExitPos, myGeom, angle)) {
894-
if (!shrouded)
895-
TheTerrainVisual->addFactionBib(them, true);
897+
if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud())
898+
return LBC_SHROUD;
899+
900+
TheTerrainVisual->addFactionBib(them, true);
896901
return LBC_OBJECTS_IN_THE_WAY;
897902
}
898903
}

0 commit comments

Comments
 (0)