mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
fix crash whn player joins in spectator mode
This commit is contained in:
parent
9c46a1f141
commit
893f7cb6ef
@ -657,6 +657,7 @@ class NetworkSession{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function syncMovement(Vector3 $pos, ?float $yaw = null, ?float $pitch = null, int $mode = MovePlayerPacket::MODE_NORMAL) : void{
|
public function syncMovement(Vector3 $pos, ?float $yaw = null, ?float $pitch = null, int $mode = MovePlayerPacket::MODE_NORMAL) : void{
|
||||||
|
if($this->player !== null){
|
||||||
$location = $this->player->getLocation();
|
$location = $this->player->getLocation();
|
||||||
$yaw = $yaw ?? $location->getYaw();
|
$yaw = $yaw ?? $location->getYaw();
|
||||||
$pitch = $pitch ?? $location->getPitch();
|
$pitch = $pitch ?? $location->getPitch();
|
||||||
@ -672,6 +673,7 @@ class NetworkSession{
|
|||||||
|
|
||||||
$this->sendDataPacket($pk);
|
$this->sendDataPacket($pk);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function syncViewAreaRadius(int $distance) : void{
|
public function syncViewAreaRadius(int $distance) : void{
|
||||||
$this->sendDataPacket(ChunkRadiusUpdatedPacket::create($distance));
|
$this->sendDataPacket(ChunkRadiusUpdatedPacket::create($distance));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user