@@ -670,9 +670,6 @@ 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 ())
674- return LBC_SHROUD;
675-
676673 Bool feedbackWithFailure = TRUE ;
677674 Relationship rel = builderObject ? builderObject->getRelationship ( them ) : NEUTRAL;
678675
@@ -695,16 +692,6 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos
695692 }
696693 }
697694
698- // Kris: Patch 1.01 - November 5, 2003
699- // Prevent busy units (black lotus hacking from being moved by trying to place a building -- exploit).
700- if ( rel == ALLIES )
701- {
702- if ( them->testStatus ( OBJECT_STATUS_IS_USING_ABILITY ) || them->getAI () && them->getAI ()->isBusy () )
703- {
704- return LBC_OBJECTS_IN_THE_WAY;
705- }
706- }
707-
708695 // ignore any kind of class of objects that we will "remove" for building
709696 if ( isRemovableForConstruction ( them ) == TRUE )
710697 continue ;
@@ -718,13 +705,28 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos
718705 if (them->isKindOf (KINDOF_INERT))
719706 continue ;
720707
721- // an immobile object may obstruct our building depending on flags.
722- if ( them->isKindOf ( KINDOF_IMMOBILE ) )
708+ if (them->isKindOf (KINDOF_IMMOBILE))
723709 {
724- if (onlyCheckEnemies && builderObject && rel != ENEMIES )
725- {
710+ if (onlyCheckEnemies && builderObject && rel != ENEMIES)
726711 continue ;
712+ }
713+
714+ if (builderObject && them->getShroudedStatus (builderObject->getControllingPlayer ()->getPlayerIndex ()) >= OBJECTSHROUD_FOGGED)
715+ return LBC_SHROUD;
716+
717+ // Kris: Patch 1.01 - November 5, 2003
718+ // Prevent busy units (black lotus hacking from being moved by trying to place a building -- exploit).
719+ if (rel == ALLIES)
720+ {
721+ if (them->testStatus (OBJECT_STATUS_IS_USING_ABILITY) || them->getAI () && them->getAI ()->isBusy ())
722+ {
723+ return LBC_OBJECTS_IN_THE_WAY;
727724 }
725+ }
726+
727+ // an immobile object may obstruct our building depending on flags.
728+ if ( them->isKindOf ( KINDOF_IMMOBILE ) )
729+ {
728730 if ( feedbackWithFailure )
729731 {
730732 TheTerrainVisual->addFactionBib ( them, TRUE );
@@ -869,7 +871,7 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos
869871
870872 // an immobile object will obstruct our building no matter what team it's on
871873 if ( them->isKindOf ( KINDOF_IMMOBILE ) ) {
872- Bool shrouded = them-> getDrawable () && them->getDrawable ( )->getFullyObscuredByShroud () ;
874+ Bool shrouded = builderObject && them->getShroudedStatus (builderObject-> getControllingPlayer ( )->getPlayerIndex ()) >= OBJECTSHROUD_FOGGED ;
873875 /* Check for overlap of my exit rectangle to his geom info. */
874876 if (checkMyExit && ThePartitionManager->geomCollidesWithGeom (them->getPosition (), hisBounds, them->getOrientation (),
875877 &myExitPos, myGeom, angle)) {
0 commit comments