Skip to content

Fix game crashing if DLC has XMLVERSION paramater#1285

Open
sestain wants to merge 1 commit intosmartcmd:mainfrom
sestain:DLC-XMLVERSION-Fix
Open

Fix game crashing if DLC has XMLVERSION paramater#1285
sestain wants to merge 1 commit intosmartcmd:mainfrom
sestain:DLC-XMLVERSION-Fix

Conversation

@sestain
Copy link

@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
Collaborator

rtm516 commented Mar 17, 2026

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

@sestain
Copy link
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).

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.

2 participants