Add NPC IsInvisible check to LocationOfTownsfolk#603
Merged
drewhoener merged 1 commit intoAnnosz:masterfrom Nov 7, 2024
Abagaianye:master
Merged
Add NPC IsInvisible check to LocationOfTownsfolk#603drewhoener merged 1 commit intoAnnosz:masterfrom Abagaianye:master
drewhoener merged 1 commit intoAnnosz:masterfrom
Abagaianye:master
Conversation
Stops invisible NPCs from being shown on the map until they are visible 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.
NOTE: If I understand correctly, you're currently in the process of rewriting UI Info Suite and therefore may not be interested in PRs that change the current implementation of it. I wanted to make this PR anyway so that I flagged the issue of NPC invisibility for you in case you wanted to adjust the new implementation to deal with it :)
Issue
Currently NPCs who are set as invisible (like Elliott on his 14-heart event or other NPCs via the trigger action implemented in 1.6) will still be visible on the world map despite not being visible or able to be interacted with in game.
Change
Added
&& character.IsInvisible != trueinside code that determines whether a character should be eligible to be drawn on the map.Purpose
If an NPC is invisible, this change will prevent them from being eligible for being on the list of villagers to display on the world map. Once they are visible, they will be added to the list and can be displayed on the world map.
Testing
Has been tested and confirmed to work in single player and multiplayer. Works with vanilla and custom NPCs. Changes to NPC visibility on the map don't happen until next day if NPC is made invisible/visible partway through a day.