-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Reverting PR #4264
Reverting PR #4264
Conversation
@danyelvarejao can you check this please |
Summary of changes: Before: if either force load or reloading AND the monster is not loaded, then load. That means that if the monster was already loaded, then After: |
I think it should be like @ranisalt said. if (forceLoad || (reloading && monsters.find(it.first) != monsters.end())) { |
It literally makes no difference to wrap that statement around parentheses as that is what the order of operators is already doing, i.e. BEDMAS/PEDMAS in math, AND (&&) operators have precedence over OR (||) |
For reference: https://en.cppreference.com/w/cpp/language/operator_precedence It would be good to wrap for clarity, it's not that obvious |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To whoever merges this, please add a proper commit message
I love chatGTP |
This commit updates the monster loading behavior to now fully consider the 'forceLoad' flag, regardless of whether the monster was already loaded or not. Previously, if the monster was already loaded, the 'forceLoad' flag had no effect. Now, the updated behavior reads as follows: "if (forceLoad || (reloading && monsters.find(it.first) != monsters.end()))", meaning that if 'forceLoad' is set to true, the monster will be loaded even if it was already loaded before. This change improves the consistency and flexibility of the monster loading system.
Pull Request Prelude
Changes Proposed
Fixes #4263
Reverts https://github.com/otland/forgottenserver/pull/3495/files
Issues addressed: 4263