-
Notifications
You must be signed in to change notification settings - Fork 202
bugfix: Restore retail compatibility after retail behavior flags change #2727
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,8 +23,20 @@ | |||||||||||||
| // Note: Retail compatibility must not be broken before this project officially does. | ||||||||||||||
| // Use RETAIL_COMPATIBLE_CRC and RETAIL_COMPATIBLE_XFER_SAVE to guard breaking changes. | ||||||||||||||
|
|
||||||||||||||
| #ifndef RETAIL_COMPATIBLE_CRC | ||||||||||||||
| #define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04 | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef RETAIL_COMPATIBLE_XFER_SAVE | ||||||||||||||
| #define RETAIL_COMPATIBLE_XFER_SAVE (1) // Game is expected to be Xfer Save compatible with retail Generals 1.08, Zero Hour 1.04 | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #if RETAIL_COMPATIBLE_CRC || !defined(PRESERVE_RETAIL_BEHAVIOR) | ||||||||||||||
| #define PRESERVE_RETAIL_BEHAVIOR (1) // Retain specific behavior present in retail Generals 1.08 and Zero Hour 1.04. Should only be used in this file. | ||||||||||||||
| #endif | ||||||||||||||
|
Comment on lines
+34
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: Core/GameEngine/Include/Common/GameDefines.h
Line: 34-36
Comment:
The `PRESERVE_RETAIL_BEHAVIOR` condition is always true at this point in the file, making `RETAIL_COMPATIBLE_CRC` have no practical effect. When `RETAIL_COMPATIBLE_CRC` is 0, the expression evaluates to `0 || !defined(PRESERVE_RETAIL_BEHAVIOR)`. Since `PRESERVE_RETAIL_BEHAVIOR` has not been defined yet at this location, `!defined(PRESERVE_RETAIL_BEHAVIOR)` is unconditionally true, so the macro is set to 1 regardless of the CRC flag. A developer setting `RETAIL_COMPATIBLE_CRC=0` to test bug-fixed code will find that all `PRESERVE_RETAIL_BEHAVIOR`-gated paths (building resumption delay, multi-crate pickup, flame-kill XP, structure stealth, unreliable firestorms, money-per-minute) remain active.
```suggestion
#ifndef PRESERVE_RETAIL_BEHAVIOR
#define PRESERVE_RETAIL_BEHAVIOR RETAIL_COMPATIBLE_CRC // Retain specific behavior present in retail Generals 1.08 and Zero Hour 1.04. Should only be used in this file.
#endif
```
How can I resolve this? If you propose a fix, please make it concise.
xezon marked this conversation as resolved.
|
||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_BUILDING_RESUMPTION_DELAY | ||||||||||||||
| #define PRESERVE_BUILDING_RESUMPTION_DELAY (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #define PRESERVE_BUILDING_RESUMPTION_DELAY PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem here is that you have re-enabled the retail behaviour being used when retail compatibler CRC is disabled. |
||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_CHINOOK_PASSENGER_DUMPING | ||||||||||||||
|
|
@@ -36,11 +48,11 @@ | |||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_MULTI_CRATE_PICKUP | ||||||||||||||
| #define PRESERVE_MULTI_CRATE_PICKUP (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #define PRESERVE_MULTI_CRATE_PICKUP PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_NO_XP_FROM_FLAME_KILLS | ||||||||||||||
| #define PRESERVE_NO_XP_FROM_FLAME_KILLS (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #define PRESERVE_NO_XP_FROM_FLAME_KILLS PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_NO_XP_FROM_OCL_KILLS | ||||||||||||||
|
|
@@ -68,29 +80,21 @@ | |||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR | ||||||||||||||
| #define PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #define PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_TUNNEL_HEAL_STACKING | ||||||||||||||
| #define PRESERVE_TUNNEL_HEAL_STACKING (1) | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_UNRELIABLE_FIRESTORMS | ||||||||||||||
| #define PRESERVE_UNRELIABLE_FIRESTORMS (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #define PRESERVE_UNRELIABLE_FIRESTORMS PRESERVE_RETAIL_BEHAVIOR // The fix for this unfavorable behavior was approved by the Game Design Committee. | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef PRESERVE_RETAIL_SCRIPTED_CAMERA | ||||||||||||||
| #define PRESERVE_RETAIL_SCRIPTED_CAMERA (1) // Retain scripted camera behavior present in retail Generals 1.08 and Zero Hour 1.04 | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef RETAIL_COMPATIBLE_CRC | ||||||||||||||
| #define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04 | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef RETAIL_COMPATIBLE_XFER_SAVE | ||||||||||||||
| #define RETAIL_COMPATIBLE_XFER_SAVE (1) // Game is expected to be Xfer Save compatible with retail Generals 1.08, Zero Hour 1.04 | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| // This is here to easily toggle between the retail compatible with fixed pathfinding fallback and pure fixed pathfinding mode | ||||||||||||||
| #ifndef RETAIL_COMPATIBLE_PATHFINDING | ||||||||||||||
| #define RETAIL_COMPATIBLE_PATHFINDING (1) | ||||||||||||||
|
|
@@ -123,7 +127,7 @@ | |||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #ifndef ALLOW_MONEY_PER_MINUTE_FOR_PLAYER | ||||||||||||||
| #define ALLOW_MONEY_PER_MINUTE_FOR_PLAYER (0) // When enabled, a money-per-minute stat is calculated and displayed in-game | ||||||||||||||
| #define ALLOW_MONEY_PER_MINUTE_FOR_PLAYER PRESERVE_RETAIL_BEHAVIOR // When enabled, a money-per-minute stat is calculated and displayed in-game | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| // Previously the configurable shroud sat behind #if defined(RTS_DEBUG) | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think re-adding the
PRESEVE_RETAIL_BEHAVIORflag is really necessary.We only need to fix the site of use.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Just add
RETAIL_COMPATIBLE_CRCnext toPRESERVE_STRUCTURE_STEALTH_DURING_REPAIRandPRESERVE_MULTI_CRATE_PICKUPand this will be it.