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

Fix map finding function to make sure it's always relevant #12

Open
InfinitySamurai opened this issue Aug 2, 2020 · 0 comments
Open
Labels
enhancement New feature or request mod

Comments

@InfinitySamurai
Copy link
Collaborator

Currently there are some issue with the map that is found. It's usually the one that is currently being viewed by the player. This causes issues with some mod integrations such as the new z-level mod. At a suggestion from their discord, we could use something a bit more robust such as:

var map = Find.WorldObjects.MapParents.Where(x => x.Tile == Find.CurrentMap.Tile
                    && x.HasMap && x.Map != null && x.Map.IsPlayerHome).FirstOrDefault().Map;

Worthwhile exploring this and seeing if this snippet is fit for purpose

@InfinitySamurai InfinitySamurai added enhancement New feature or request mod labels Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mod
Projects
None yet
Development

No branches or pull requests

1 participant