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 some bugs for run_eoc_until #72020

Merged
merged 3 commits into from
Feb 27, 2024
Merged

fix some bugs for run_eoc_until #72020

merged 3 commits into from
Feb 27, 2024

Conversation

PipeYume
Copy link
Contributor

@PipeYume PipeYume commented Feb 27, 2024

Summary

Bugfixes "fix some bugs for run_eoc_until"

Purpose of change

  1. In the documentation, one field is "iteration", but in the code, the checked field is "iteration_count"

  2. When the iteration number is too large, a debugmsg occurs within eoc->activate due to the callstack of dialogue being too large.

  3. The condition of run_eoc_until can only be set in advance using set_condition. I don't understand the significance of this. Can't we just use the condition syntax directly?

Describe the solution

  1. I changed the "iteration_count" in the code to "iteration".

  2. Add a bool value require_callstack_check in eoc->activate to determine whether to amend the eoc in the callstack and check the size of callstack. Then, in run_eoc_until, amend one eoc into the callstack instead of amending several eocs into the callstack repeatedly in the iteration.

  3. use condition syntax directly.

Describe alternatives you've considered

Testing

Test function is updated.

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [JSON] Changes (can be) made in JSON Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs EOC: Effects On Condition Anything concerning Effects On Condition <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Feb 27, 2024
@GuardianDll
Copy link
Member

I think p.3 was made with idea that it would be possible to use said conditions as a separate json object, tho now we have #71956 which solves it from another direction

@PipeYume
Copy link
Contributor Author

PipeYume commented Feb 27, 2024

I think p.3 was made with idea that it would be possible to use said conditions as a separate json object, tho now we have #71956 which solves it from another direction

get_condition could be able to achieve the functionality of using the same condition across different EOCs I think.
get_condition can only retrieve the condition in a dialogue that has been set by set_condition (

In p3, I actually meant to express that the previous run_eoc_until could only use the condition specified by set_condition and could not directly use the common condition syntax.
(The original "condition": "a name" is equivalent to "condition": {"get_condition": "a name"}. Common condition syntax can also load the condition. )

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 27, 2024
@dseguin dseguin merged commit a1a610b into CleverRaven:master Feb 27, 2024
23 of 27 checks passed
@PipeYume PipeYume deleted the FIX_RUN_EOC_WITH branch February 28, 2024 01:10
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) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants