mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Fit attribute value to range when applying slowness, close #410
According to http://minecraft.gamepedia.com/Status_effect#Slowness, anything higher than slowness 7 will cause the player to be unable to move. Therefore this value should be clamped to a minimum of 0, not crash.
This commit is contained in:
parent
132e04fdbb
commit
7fb3c7343f
@ -293,7 +293,7 @@ class Effect{
|
||||
$speed = $attr->getValue();
|
||||
}
|
||||
$speed *= (1 - 0.15 * $this->amplifier);
|
||||
$attr->setValue($speed);
|
||||
$attr->setValue($speed, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user