Skip to content

Commit 835d9e7

Browse files
committed
chore: Explicitly re-implement exploit
1 parent fb35aa8 commit 835d9e7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Core/GameEngine/Include/Common/GameDefines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// Note: Retail compatibility must not be broken before this project officially does.
2222
// Use RETAIL_COMPATIBLE_CRC and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes.
2323

24+
#ifndef RETAIL_COMPATIBLE_BUG
25+
#define RETAIL_COMPATIBLE_BUG (1) // Retain bugs present in retail Generals 1.08 and Zero Hour 1.04
26+
#endif
27+
2428
#ifndef RETAIL_COMPATIBLE_CRC
2529
#define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04
2630
#endif

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,15 @@ Bool addDrawableToList( Drawable *draw, void *userData )
374374
return FALSE;
375375
}
376376

377+
#if RETAIL_COMPATIBLE_BUG
378+
// In retail, hidden objects such as passengers are included here when drag-selected, which causes
379+
// enemy selection logic to exit early (only 1 enemy unit can be selected at a time). Some players
380+
// exploit this bug to determine if a transport contains passengers and consider this an important
381+
// feature and an advanced skill to pull off, so we must leave the exploit.
382+
if (draw->getObject() && draw->getObject()->getContain() && draw->getObject()->getContain()->getContainCount() > 0)
383+
pds->drawableListToFill->push_back(draw); // Just add the unit twice to prevent enemy selections
384+
#endif
385+
377386
pds->drawableListToFill->push_back(draw);
378387
return TRUE;
379388
}

0 commit comments

Comments
 (0)