mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Entity: require scale > 0 in setScale(), fixes #2563
This commit is contained in:
parent
660d42e8d1
commit
cbb9c4f298
@ -637,6 +637,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
* @param float $value
|
* @param float $value
|
||||||
*/
|
*/
|
||||||
public function setScale(float $value) : void{
|
public function setScale(float $value) : void{
|
||||||
|
if($value <= 0){
|
||||||
|
throw new \InvalidArgumentException("Scale must be greater than 0");
|
||||||
|
}
|
||||||
$multiplier = $value / $this->getScale();
|
$multiplier = $value / $this->getScale();
|
||||||
|
|
||||||
$this->width *= $multiplier;
|
$this->width *= $multiplier;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user