Open Muqsit opened 7 years ago
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.
https://github.com/pmmp/PocketMine-MP/blob/2d3ce9e8b027161c9d8b4145c94a3813d1ab9497/src/pocketmine/entity/Effect.php#L361
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