Skip to content

Commit fb35aa8

Browse files
committed
refactor: Improve conditional shroud logic
1 parent 95458b4 commit fb35aa8

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ Bool addDrawableToList( Drawable *draw, void *userData )
349349
if (!pds->drawableListToFill)
350350
return FALSE;
351351

352+
if (draw->getFullyObscuredByShroud())
353+
return FALSE;
354+
352355
if (draw->isDrawableEffectivelyHidden())
353356
return FALSE;
354357

@@ -371,23 +374,6 @@ Bool addDrawableToList( Drawable *draw, void *userData )
371374
return FALSE;
372375
}
373376

374-
//Kris: Aug 9, 2003!!! Wow, this bug has been around a LONG time!!
375-
//Basically, it was possible to drag select a single enemy/neutral unit even if you couldn't see it
376-
//including stealthed units.
377-
const Object *obj = draw->getObject();
378-
if( obj )
379-
{
380-
const Player *player = ThePlayerList->getLocalPlayer();
381-
Relationship rel = player->getRelationship( obj->getTeam() );
382-
if( rel == NEUTRAL || rel == ENEMIES )
383-
{
384-
if( obj->getShroudedStatus( player->getPlayerIndex() ) >= OBJECTSHROUD_FOGGED )
385-
{
386-
return FALSE;
387-
}
388-
}
389-
}
390-
391377
pds->drawableListToFill->push_back(draw);
392378
return TRUE;
393379
}

0 commit comments

Comments
 (0)