Make MP configs optional in single-player#2045
Open
TmLev wants to merge 1 commit intoOpenXRay:devfrom
Open
Conversation
Xottab-DUTY
requested changes
Feb 8, 2026
Member
There was a problem hiding this comment.
- I'm strictly against adding feature/game-specific information to
CInifile. In other words, LTX loader should not know what it is loading. It's task is just load or report failure.- Optionally not loading an include is very wrong and can cause more problems than fixing something. It should be handled on the gamedata side, i.e. modder must provide the file being included or remove the
#includeinvocation.
- Optionally not loading an include is very wrong and can cause more problems than fixing something. It should be handled on the gamedata side, i.e. modder must provide the file being included or remove the
- The correct approach is to remove
R_ASSERTs from the game code and make sure it works. This is what you did withUIGameCustom.cppand it's the correct path! - Just FYI: mp_ranks is a file, not a folder. Modders wrongly assume it's MP-only, but it was always used in single player too. To be precise, NPCs use weapon ranks from
mp_ranks.ltxto determine which weapon is better. - Almost forgot to say thanks for handling this. Thanks!
Single-player should not hard-require multiplayer configuration under `gamedata/configs/mp/`. Previously, `CMapListHelper` always loaded `$game_config$/mp/map_list.ltx` and asserted that maps/weathers were present. For SP-only installs or story mods that remove MP configs, that made startup/save-load fail and also forced expensive archive scanning. Changes: - Treat `mp/map_list.ltx` (and its `[weather]` section) as optional: if missing, log and keep MP map/weather lists empty. - Remove `R_ASSERT`s and avoid dereferencing null map list entries; return an empty "unknown" map list when queried. Notes: - The LTX/INI loader remains strict and generic (missing `#include` targets still fail). - `mp_ranks.ltx` is still expected for NPC weapon ranking; it is not MP-only.
44cec84 to
7e2b6a4
Compare
Contributor
Author
|
@Xottab-DUTY thanks for the feedback! Amended; could you please review again? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Single-player should not hard-require multiplayer configuration under
gamedata/configs/mp/.Previously,
CMapListHelperalways loaded$game_config$/mp/map_list.ltxand asserted that maps/weathers were present. For SP-only installs or story mods that remove MP configs, that made startup/save-load fail and also forced expensive archive scanning.Changes:
mp/map_list.ltx(and its[weather]section) as optional: if missing, log and keep MP map/weather lists empty.R_ASSERTs and avoid dereferencing null map list entries; return an empty "unknown" map list when queried.Notes:
#includetargets still fail).mp_ranks.ltxis still expected for NPC weapon ranking; it is not MP-only.Resolves #1302.