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
Slowness Effect levels >= 7 do not reset FOV when removed #1551
Comments
I remember having this issue on earlier versions(dating back to 0.15). Running fixed it for me. |
The only way I can reproduce this is by using excessive amplifiers (>= 7) so that the player's speed decreases to zero. Is that what you're describing? |
Yes. In vanilla, the speed does get put to zero when you use amplifier >= 7 but the FOV reverts back to normal once slowness goes away. |
The problem arises here: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/Effect.php#L474 - due to the dividend of the operation being zero. It's capped (is that the right word?) at zero when adding the effect and can't go below that. In vanilla I think this is handled using attribute modifiers which effectively change the output value of an attribute, instead of modifying its base value directly. This is not implemented in PocketMine-MP. Not sure how best to fix this - I don't think there's any real non-hacky way to do it. |
this sets negative value if effectlevel is >=7 how about $attr->setValue(max($attr->getMinValue(),$attr->getValue() / (1 - 0.15 * $instance->getEffectLevel())));
|
Issue description
Steps to reproduce the issue
OS and versions
Plugins
The text was updated successfully, but these errors were encountered: