Allow for multiple game sub-elements #1287
Merged
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.
Since the reintroduction of includes, there's been a rise in (or comeback of) "unofficial" gamemodes. These gamemode include files tend to have a
<game>GAMEMODE NAME</game>
sub-element each.This means that currently, gamemodes like King's Conquest, Ghost Squadron, Blasternauts, Monster Mash, OITQ or Lifesteal can't be mixed with one another, as PGM will complain about
Multiple values for 'game'
I believe allowing for multiple of these sub-elements and just using the last defined one makes the most sense here, as the other option would be to have no
<game>
element in includes and always having to define it per map.This change would allow you to combine, for instance, Ghost Squadron and Lifesteal, a compatible combination which wasn't previously possible due to each include file having
<game>Ghost Squadron</game>
and<game>Lifesteal</game>
respectively.With this, you'd be able to combine them and add a custom
<game>GS and Lifesteal</game>
line to that specific map's XML after its include calls (or just use the gamemode from the last defined include, if you wanted to)This concept could go even further to also allow for multiple objectives (for includes that have those), but that's not part of this PR at the moment.
I have tested this in a local server.