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

Scope lighthouse quest variables to NPC, not global #73097

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

RenechCDDA
Copy link
Member

Summary

Bugfixes "Lighthouse clear quest can be completed again"

Purpose of change

Describe the solution

Variables were accidentally migrated to global(?!) in #71027 by prefixing npc_. The correct prefix is n_. npc_has_var was correctly checking the NPC for the variable, but the variable was held in global scope.

I changed the existing instances of the global npc_count_cleaning_lighthouse_man to n_count_cleaning_lighthouse_man, which makes npctalkvars local to the beta talker (the NPC in question).

Describe alternatives you've considered

Making everything global /shrug

Testing

Confirmed that the quest was completable on the provided save, even though the quest NPC did not already have the npctalkvar initialized. Confirmed that newly received quests properly set the var on the NPC and it can be completed as normal with that new NPC.

Additional context

It looks like John Bailey's training dialogue was also accidentally migrated to global. https://github.com/CleverRaven/Cataclysm-DDA/pull/71027/files#diff-3ce8cc7bacf285a65d92aa9f8d6b8b777d192d993c061a0f4fc4efdfde8c9f04R530-R531

However because of the way the condition is set up, it still checks against the now global variable.

This PR does not migrate or handle the global var in existing saves. It will remain as unused data, but that should not have any impact besides a few extra characters in the save file.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [JSON] Changes (can be) made in JSON <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Apr 18, 2024
@dseguin dseguin merged commit 2e32db9 into CleverRaven:master Apr 23, 2024
20 of 24 checks passed
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 23, 2024
@RenechCDDA RenechCDDA deleted the fix_lighthouse branch April 23, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The man from the lighthouse quest doesn't work
2 participants