pop talker from dialogue if they are dead#85935
Open
GuardianDll wants to merge 1 commit intomasterfrom
Open
Conversation
Member
Author
|
Lmao, yeah it's a bad fallback, unfortunately it is much bigger in scope than what i am fixing here, and i don't think there is a good way to resolve it overall except by terminating the quest in some way |
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.
Summary
None
Purpose of change
Received next EoC from modder
{ "type": "effect_on_condition", "id": "EOC_foobar", "//": "n_ is the item", "effect": [ "n_die", { "u_spawn_item": "another_item" }, ] },what it does is tries to spawn another_item, but
u_spawn_itemhas a code that checks if opposite talker is presented, and if so, creates a popup "npc_name gives you Foo". Sadly in this case"n_die"killed our NPC before, but didn't made the dialogue aware about it, making this json result in crashDescribe the solution
Pop talker from dialogue if _die effect is used, so future code can safely use has_talker() and bail out if talker is not presented, or throw an error for calling talker when such do not exist anymore
Testing
Run the same code, instead of segfault, the game is properly guarded by has_talker(), do not try to access talker name and, therefore, do not segfault