Skip to content

Adventure Mode Site Helpers: SC_NEW_MAP_AVAILABLE state change and World::GetCurrentSiteIdsWithExtraRange #5475

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

UnknowableCoder
Copy link

After doing some research on the ways to properly get access to site IDs in Adventure Mode, I realized the SC_MAP_LOADED state change only triggers on transitioning from no map to having a map loaded. The logic can easily be expanded to also consider the cases when there is a map and the map changes. For this, I propose a new state change, which I have tentatively called SC_NEW_MAP_AVAILABLE.

In the same vein, while World::GetCurrentSiteId should correctly return the current site ID (or -1 if no site), some practical use cases may benefit from being able to get all sites in a caller-provided range around the adventurer. For this reason, I propose the introduction of World::GetCurrentSiteIdsWithExtraRange, which extends the logic of the former function to take an std::vector as an in-parameter and return all applicable sites, optionally with extra range in x and y and a maximum number of sites to be return (which would be ordered by ID and not distance...).

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