mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
World: clamp clickVector components from 0-1
this ensures that #5827 won't randomly start crashing if clients give bad values.
This commit is contained in:
parent
6f82942c64
commit
8dedbb7471
@ -2032,6 +2032,12 @@ class World implements ChunkManager{
|
||||
|
||||
if($clickVector === null){
|
||||
$clickVector = new Vector3(0.0, 0.0, 0.0);
|
||||
}else{
|
||||
$clickVector = new Vector3(
|
||||
min(1.0, max(0.0, $clickVector->x)),
|
||||
min(1.0, max(0.0, $clickVector->y)),
|
||||
min(1.0, max(0.0, $clickVector->z))
|
||||
);
|
||||
}
|
||||
|
||||
if(!$this->isInWorld($blockReplace->getPosition()->x, $blockReplace->getPosition()->y, $blockReplace->getPosition()->z)){
|
||||
|
Loading…
x
Reference in New Issue
Block a user