-
Notifications
You must be signed in to change notification settings - Fork 121
bugfix(input): Prevent drag-selecting enemy beacons and enable selecting stealthed units while observing #1460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ffe37ab
95458b4
fb35aa8
835d9e7
6977bb1
0c8d08a
af1f72f
ee83015
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,6 +349,14 @@ Bool addDrawableToList( Drawable *draw, void *userData ) | |
| if (!pds->drawableListToFill) | ||
| return FALSE; | ||
|
|
||
| #if !RTS_GENERALS || !RETAIL_COMPATIBLE_BUG | ||
| if (draw->getFullyObscuredByShroud()) | ||
| return FALSE; | ||
|
|
||
| if (draw->isDrawableEffectivelyHidden()) | ||
| return FALSE; | ||
| #endif | ||
|
|
||
| if (!draw->getTemplate()->isAnyKindOf(pds->kindofsToMatch)) | ||
| return FALSE; | ||
|
|
||
|
|
@@ -368,28 +376,15 @@ Bool addDrawableToList( Drawable *draw, void *userData ) | |
| return FALSE; | ||
| } | ||
|
|
||
| //Kris: Aug 9, 2003!!! Wow, this bug has been around a LONG time!! | ||
| //Basically, it was possible to drag select a single enemy/neutral unit even if you couldn't see it | ||
| //including stealthed units. | ||
| const Object *obj = draw->getObject(); | ||
| if( obj ) | ||
| { | ||
| const Player *player = ThePlayerList->getLocalPlayer(); | ||
| Relationship rel = player->getRelationship( obj->getTeam() ); | ||
| if( rel == NEUTRAL || rel == ENEMIES ) | ||
| { | ||
| if( obj->getShroudedStatus( player->getPlayerIndex() ) >= OBJECTSHROUD_FOGGED ) | ||
| { | ||
| return FALSE; | ||
| } | ||
|
|
||
| //If stealthed, no way! | ||
| if( obj->testStatus( OBJECT_STATUS_STEALTHED ) && !obj->testStatus( OBJECT_STATUS_DETECTED ) ) | ||
| { | ||
| return FALSE; | ||
|
||
| } | ||
| } | ||
| } | ||
| #if !RTS_GENERALS && RETAIL_COMPATIBLE_BUG | ||
| // TheSuperHackers @info | ||
| // In retail, hidden objects such as passengers are included here when drag-selected, which causes | ||
xezon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // enemy selection logic to exit early (only 1 enemy unit can be selected at a time). Some players | ||
| // exploit this bug to determine if a transport contains passengers and consider this an important | ||
| // feature and an advanced skill to pull off, so we must leave the exploit. | ||
| if (draw->getObject() && draw->getObject()->getContain() && draw->getObject()->getContain()->getContainCount() > 0) | ||
| pds->drawableListToFill->push_back(draw); // Just add the unit twice to prevent enemy selections | ||
| #endif | ||
|
|
||
| pds->drawableListToFill->push_back(draw); | ||
| return TRUE; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.