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 (Newer DLCs has this paramater to my knowledge).

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]

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.

1 participant