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: transform item logic crash #2517

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented 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.

@dudantas dudantas changed the title fix: transform item logic error fix: transform item logic crash Apr 2, 2024
@pedrohfk
Copy link
Contributor

pedrohfk commented Apr 2, 2024

I uploaded the correction and it is now working 100%. Thanks.

@dudantas dudantas merged commit 8479c16 into main Apr 2, 2024
34 checks passed
@dudantas dudantas deleted the dudantas/fix-transform-item-logic-error branch April 2, 2024 19:38
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.

void ProtocolGame::sendInventoryIds
4 participants