forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 245
unify(map): Move GameLogic map headers and implementations to Core #3190
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
Open
OmarAglan
wants to merge
2
commits into
TheSuperHackers:main
Choose a base branch
from
OmarAglan:unify/gamelogic-map-core
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -429,23 +429,29 @@ static AsciiString static_readPlayerNames[MAX_PLAYER_COUNT]; | |
| * Input: DataChunkInput | ||
| * | ||
| */ | ||
| #if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC) | ||
| #define K_PLAYERS_NAMES_FOR_SCRIPTS_VERSION_1 1 | ||
| #define K_PLAYERS_NAMES_FOR_SCRIPTS_VERSION_2 2 | ||
| #endif | ||
|
|
||
| static Bool ParsePlayersDataChunk(DataChunkInput &file, DataChunkInfo *info, void *userData) | ||
| { | ||
| #if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC) | ||
| Int readDicts = 0; | ||
| if (info->version >= K_PLAYERS_NAMES_FOR_SCRIPTS_VERSION_2) { | ||
| readDicts = file.readInt(); | ||
|
Comment on lines
+439
to
442
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. 2. Scriptsplayers v2 crc misparse ParsePlayersDataChunk compiles out reading the v2 preamble/int+dict payload when `RTS_GENERALS && RETAIL_COMPATIBLE_CRC, so a v2 ScriptsPlayers` chunk (written by Zero Hour WorldBuilder) will be misread (first int treated as numNames), leading to out-of-bounds reads and/or chunk-length assertion failures. This creates a crash-on-load path for cross-game/custom .scb script files in Generals retail-CRC builds. Agent Prompt
|
||
| } | ||
| #endif | ||
| Int numNames = file.readInt(); | ||
| Int i; | ||
| for (i=0; i<numNames; i++) { | ||
| if (i>=MAX_PLAYER_COUNT) break; | ||
| static_readPlayerNames[i] = file.readAsciiString(); | ||
| #if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC) | ||
| if (readDicts) { | ||
| Dict sideDict = file.readDict(); | ||
| } | ||
| #endif | ||
| } | ||
| DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); | ||
| return true; | ||
|
|
@@ -1131,7 +1137,11 @@ void TeamsInfoRec::addTeam(const Dict* d) | |
| TEAM_ALLOC_CHUNK = 8 ///< how many teams to alloc at a time | ||
| }; | ||
|
|
||
| #if RTS_GENERALS && RETAIL_COMPATIBLE_CRC | ||
| DEBUG_ASSERTCRASH(m_numTeams < 1024, ("hmm, seems like an awful lot of teams...")); | ||
| #else | ||
| DEBUG_ASSERTCRASH(m_numTeams < 2048, ("%d teams have been allocated (so far). This seems excessive.", m_numTeams )); | ||
| #endif | ||
| if (m_numTeams >= m_numTeamsAllocated) | ||
| { | ||
| // pool[]ify | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
1. Trigger v4 crc misparse
🐞 Bug☼ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools