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

Slowness Effect levels >= 7 do not reset FOV when removed #1551

Open
Muqsit opened this issue Nov 17, 2017 · 5 comments
Open

Slowness Effect levels >= 7 do not reset FOV when removed #1551

Muqsit opened this issue Nov 17, 2017 · 5 comments
Labels
Category: Gameplay Related to Minecraft gameplay experience Status: Debugged Cause of the bug has been found, but not fixed Type: To Do

Comments

@Muqsit
Copy link
Contributor

Muqsit commented Nov 17, 2017

Issue description

  • Expected result: FOV reverts back to normal after slowness effect is removed/expires.
  • Actual result: FOV does not revert back to normal until you rejoin. This cannot be reproduced in vanilla.

Steps to reproduce the issue

  1. /give slowness 1 100
  2. Your FOV wont revert back.

OS and versions

  • PocketMine-MP: 48a7627
  • PHP: 7.2RC6
  • Server OS: Ubuntu 14.04 LTS 64-bit
  • Game version: Win10

Plugins

  • Test on a clean server without plugins: Issue still exists
@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Status: Unconfirmed Bug has not yet been reproduced by a maintainer labels Nov 17, 2017
@sylvrs
Copy link
Contributor

sylvrs commented Nov 17, 2017

I remember having this issue on earlier versions(dating back to 0.15). Running fixed it for me.

@dktapps
Copy link
Member

dktapps commented Nov 19, 2017

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?

@Muqsit
Copy link
Contributor Author

Muqsit commented Nov 19, 2017

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.

@dktapps dktapps added Status: Debugged Cause of the bug has been found, but not fixed and removed Status: Unconfirmed Bug has not yet been reproduced by a maintainer labels Nov 22, 2017
@dktapps
Copy link
Member

dktapps commented Dec 4, 2017

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.

@dktapps dktapps changed the title Slowness Effect messes with the FOV Slowness Effect levels >= 7 do not reset FOV when removed Dec 13, 2017
@djdisodo
Copy link
Contributor

djdisodo commented Jul 29, 2018

$attr->setValue($attr->getValue() / (1 - 0.15 * $instance->getEffectLevel()));

this sets negative value if effectlevel is >=7
how about
$attr->setValue(max($attr->getMinValue(),$attr->getValue() / (1 - 0.15 * $instance->getEffectLevel())));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Status: Debugged Cause of the bug has been found, but not fixed Type: To Do
Projects
None yet
Development

No branches or pull requests

4 participants