diff --git a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index cd13b50a308..81188ae2f90 100644 --- a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -656,7 +656,9 @@ void BuildAssistant::iterateFootprint( const ThingTemplate *build, //------------------------------------------------------------------------------------------------- -/** Check for objects preventing building at this location. */ +/** Check for objects preventing building at this location. + * TheSuperHackers @tweak Stubbjax 05/09/2025 Return LBC_SHROUD for shrouded objects near the + * edge of the shroud so that players cannot use this info to determine whether they exist. */ //------------------------------------------------------------------------------------------------- Bool BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos, const ThingTemplate *build, @@ -674,6 +676,8 @@ Bool BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos, MemoryPoolObjectHolder hold(iter); for( them = iter->first(); them; them = iter->next() ) { + if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud()) + return false; // ignore any kind of class of objects that we will "remove" for building if( isRemovableForConstruction( them ) == TRUE ) @@ -803,22 +807,26 @@ Bool BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos, // an immobile object will obstruct our building no matter what team it's on if ( them->isKindOf( KINDOF_IMMOBILE ) ) { + Bool shrouded = them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud(); /* Check for overlap of my exit rectangle to his geom info. */ if (checkMyExit && ThePartitionManager->geomCollidesWithGeom(them->getPosition(), hisBounds, them->getOrientation(), &myExitPos, myGeom, angle)) { - TheTerrainVisual->addFactionBib(them, true); + if (!shrouded) + TheTerrainVisual->addFactionBib(them, true); return false; } // Check for overlap of his exit rectangle with my geom info if (checkHisExit && ThePartitionManager->geomCollidesWithGeom(&hisExitPos, hisGeom, them->getOrientation(), worldPos, myBounds, angle)) { - TheTerrainVisual->addFactionBib(them, true); + if (!shrouded) + TheTerrainVisual->addFactionBib(them, true); return false; } // Check both exit rectangles together. if (checkMyExit&&checkHisExit&&ThePartitionManager->geomCollidesWithGeom(&hisExitPos, hisGeom, them->getOrientation(), &myExitPos, myGeom, angle)) { - TheTerrainVisual->addFactionBib(them, true); + if (!shrouded) + TheTerrainVisual->addFactionBib(them, true); return false; } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index 72704ed607b..7bd79a3f112 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -656,7 +656,9 @@ void BuildAssistant::iterateFootprint( const ThingTemplate *build, //------------------------------------------------------------------------------------------------- -/** Check for objects preventing building at this location. */ +/** Check for objects preventing building at this location. + * TheSuperHackers @tweak Stubbjax 05/09/2025 Return LBC_SHROUD for shrouded objects near the + * edge of the shroud so that players cannot use this info to determine whether they exist. */ //------------------------------------------------------------------------------------------------- LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos, const ThingTemplate *build, @@ -674,8 +676,10 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos MemoryPoolObjectHolder hold(iter); for( them = iter->first(); them; them = iter->next() ) { - Bool feedbackWithFailure = TRUE; + if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud()) + return LBC_SHROUD; + Bool feedbackWithFailure = TRUE; Relationship rel = builderObject ? builderObject->getRelationship( them ) : NEUTRAL; //Kris: If the object is stealthed and we can't see it, pretend we can build there. @@ -871,21 +875,31 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos // an immobile object will obstruct our building no matter what team it's on if ( them->isKindOf( KINDOF_IMMOBILE ) ) { + Bool shrouded = them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud(); /* Check for overlap of my exit rectangle to his geom info. */ if (checkMyExit && ThePartitionManager->geomCollidesWithGeom(them->getPosition(), hisBounds, them->getOrientation(), &myExitPos, myGeom, angle)) { + if (shrouded) + return LBC_SHROUD; + TheTerrainVisual->addFactionBib(them, true); return LBC_OBJECTS_IN_THE_WAY; } // Check for overlap of his exit rectangle with my geom info if (checkHisExit && ThePartitionManager->geomCollidesWithGeom(&hisExitPos, hisGeom, them->getOrientation(), worldPos, myBounds, angle)) { + if (shrouded) + return LBC_SHROUD; + TheTerrainVisual->addFactionBib(them, true); return LBC_OBJECTS_IN_THE_WAY; } // Check both exit rectangles together. if (checkMyExit&&checkHisExit&&ThePartitionManager->geomCollidesWithGeom(&hisExitPos, hisGeom, them->getOrientation(), &myExitPos, myGeom, angle)) { + if (shrouded) + return LBC_SHROUD; + TheTerrainVisual->addFactionBib(them, true); return LBC_OBJECTS_IN_THE_WAY; }