Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback map order fix #893

Merged
merged 1 commit into from
Jul 3, 2021
Merged

Fallback map order fix #893

merged 1 commit into from
Jul 3, 2021

Conversation

applenick
Copy link
Member

Fallback map order fix

Was curious about when the random map order gets enabled.

After doing some investigating, it seems that originally the idea was if no map-pools.yml was found, then PGM should resort to using the fallback map order.

Due to the way configurations are loaded, if no map-pools.yml is provided the one located in the resources directory is read instead. So it's not currently possible to delete the map-pools.yml as a default one will be used, similar to starting a PGM server for the first time and receiving the default maps.

An alternative method would be to set the existing map-pools.yml contents as follows:

pools: []

With no defined pools, ideally PGM should recognize this and fallback to the random map order. Though due to some unsafe calls to the activeMapPool, this results in several NPEs and PGM not being able to enable.

This PR resolves that issue by ensuring the calls are safe and the fallback does in fact work 🙂

Let me know if there's any suggestions or feedback 👍

Signed-off-by: applenick applenick@users.noreply.github.com

Signed-off-by: applenick <applenick@users.noreply.github.com>
@applenick applenick added the bug Something isn't working label Jun 25, 2021
@Electroid Electroid merged commit 88e7b80 into PGMDev:dev Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants