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.
In classes that export the Effect class, we have a handleEnable method.
In this method we are creating new MultiplierModifier with uuid, and modifier as Double.
Value of modifier is obtained from config.
The problem is that it is only obtained at the beginning. And the handle method uses the previously retrieved value.
If you set a dynamic value in config, like multiplier: "%level% * 2" the handleEnable method will be executed when the pet is created and when pet is lvl1, the multipler value in this example will be set to 2.
The problem arises when the pet's level is changed, for example it reaches level 2. The new multipler value in our example should be 4.
However, since the handleEnable method was done before, the MultiplierModifier still holds the old value.
Imo best solution to this problem would be to change to MultiplierModifier to make it not store a static Double value but only a pointer to the config. Then the value would be taken in the handle method.