Skip to content

Commit 175df3f

Browse files
committed
bugfix: Check shroud using player index when placing structures
1 parent 2bbf902 commit 175df3f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ Bool BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos,
670670
MemoryPoolObjectHolder hold(iter);
671671
for( them = iter->first(); them; them = iter->next() )
672672
{
673-
if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud())
673+
if (them->getShroudedStatus(builderObject->getControllingPlayer()->getPlayerIndex()) == OBJECTSHROUD_SHROUDED)
674674
return false;
675675

676676
// ignore any kind of class of objects that we will "remove" for building
@@ -801,7 +801,7 @@ Bool BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos,
801801

802802
// an immobile object will obstruct our building no matter what team it's on
803803
if ( them->isKindOf( KINDOF_IMMOBILE ) ) {
804-
Bool shrouded = them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud();
804+
Bool shrouded = them->getShroudedStatus(builderObject->getControllingPlayer()->getPlayerIndex()) == OBJECTSHROUD_SHROUDED;
805805
/* Check for overlap of my exit rectangle to his geom info. */
806806
if (checkMyExit && ThePartitionManager->geomCollidesWithGeom(them->getPosition(), hisBounds, them->getOrientation(),
807807
&myExitPos, myGeom, angle)) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos
670670
MemoryPoolObjectHolder hold(iter);
671671
for( them = iter->first(); them; them = iter->next() )
672672
{
673-
if (them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud())
673+
if (them->getShroudedStatus(builderObject->getControllingPlayer()->getPlayerIndex()) == OBJECTSHROUD_SHROUDED)
674674
return LBC_SHROUD;
675675

676676
Bool feedbackWithFailure = TRUE;
@@ -869,7 +869,7 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos
869869

870870
// an immobile object will obstruct our building no matter what team it's on
871871
if ( them->isKindOf( KINDOF_IMMOBILE ) ) {
872-
Bool shrouded = them->getDrawable() && them->getDrawable()->getFullyObscuredByShroud();
872+
Bool shrouded = them->getShroudedStatus(builderObject->getControllingPlayer()->getPlayerIndex()) == OBJECTSHROUD_SHROUDED;
873873
/* Check for overlap of my exit rectangle to his geom info. */
874874
if (checkMyExit && ThePartitionManager->geomCollidesWithGeom(them->getPosition(), hisBounds, them->getOrientation(),
875875
&myExitPos, myGeom, angle)) {

0 commit comments

Comments
 (0)