Skip to content

Fix game crashing if DLC has XMLVERSION paramater#1285

Merged
sylvessa merged 5 commits intosmartcmd:mainfrom
sestain:DLC-XMLVERSION-Fix
Mar 27, 2026
Merged

Fix game crashing if DLC has XMLVERSION paramater#1285
sylvessa merged 5 commits intosmartcmd:mainfrom
sestain:DLC-XMLVERSION-Fix

Conversation

@sestain
Copy link
Copy Markdown
Contributor

@sestain sestain commented Mar 16, 2026

Description

Fixes a crash that was caused by XML Version paramater being at the spot which would be uiFileCount usually (This means the DLC has advanced BOX parameters, at least to my knowledge that's what it means).

Changes

Previous Behavior

Game would've crashed with DLCs which were too new.

Root Cause

If a DLC (.pck) had parameter "XMLVERSION" it would cause uiFileCount to be the XML version number (so a low number like 1-3).
This caused the game to crash.

New Behavior

Now it skips over the version number if it exists, and game doesn't crash.

Fix Implementation

Added a bool before parameters for-loop, check for parameter named "XMLVERSION", and after for-loop we use the bool to see if we skip 4 bytes or not so uiFileCount is correct.

AI Use Disclosure

No AI was used.

Related Issues

  • Fixes #[issue-number]
  • Related to #[issue-number]

@deffcolony deffcolony mentioned this pull request Mar 17, 2026
@rtm516
Copy link
Copy Markdown
Collaborator

rtm516 commented Mar 17, 2026

Shouldnt we be using the version of the dlc file not if this flag exists?

@sestain
Copy link
Copy Markdown
Contributor Author

sestain commented Mar 17, 2026

Shouldnt we be using the version of the dlc file not if this flag exists?

Not possible, since .PCK version goes only from 0 to 3, and "XMLVERSION" is just a string inside the parameters which later version of the game checks for to see if it needs to offset uiFileOffset.
DLCs that has that parameters are .PCK version 3 also (afaik).

GabsPuNs added a commit to GabsPuNs/MinecraftConsoles that referenced this pull request Mar 21, 2026
@mattsumi
Copy link
Copy Markdown
Collaborator

Please fix the Merge Conflict, and we can get this merged!

@sylvessa sylvessa merged commit 7447fab into smartcmd:main Mar 27, 2026
1 check passed
@sestain sestain deleted the DLC-XMLVERSION-Fix branch March 28, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants