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:
Dylan K. Taylor 2017-03-09 21:01:10 +00:00
parent 132e04fdbb
commit 7fb3c7343f

View File

@ -293,7 +293,7 @@ class Effect{
$speed = $attr->getValue();
}
$speed *= (1 - 0.15 * $this->amplifier);
$attr->setValue($speed);
$attr->setValue($speed, true);
}
}