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: loop related to decay items with duration #2419

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented Mar 12, 2024

Fixes a loop related to decay item with duration

Resolves #1074

loop.txt

@dudantas dudantas merged commit c6895eb into main Mar 12, 2024
34 checks passed
@dudantas dudantas deleted the dudantas/fix-loop-decay-items branch March 12, 2024 22:32
dudantas added a commit that referenced this pull request Apr 2, 2024
Resolves #2516

Related to: #2419

In the updated version of the code, we streamlined the condition for
item decay by integrating an additional check directly into the initial
if statement. Previously, we had a separate check inside the if block to
determine if the newType.decayTo value was present, which then set the
itemId accordingly. However, this approach had the potential risk of
creating unnecessary complexity and possibly leading to a loop if the
conditions weren't met as expected.

To address this and enhance clarity, we've moved the check for
newType.decayTo into the condition of the if statement itself. This
adjustment ensures that all necessary conditions are evaluated upfront,
making the code more straightforward and preventing the execution from
entering the if block unless all criteria are satisfied. This change not
only simplifies the logic but also ensures that we avoid any unintended
loops by making the transition to the else if statement more predictable
when the initial conditions are not met.
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.

[Crash] Infinite loop decay crash
1 participant