mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Get rid of some network-layer asserts
NEVER assert on user data. 🤦
This commit is contained in:
@ -114,7 +114,9 @@ class ClientboundMapItemDataPacket extends DataPacket{
|
||||
$this->yOffset = $this->getVarInt();
|
||||
|
||||
$count = $this->getUnsignedVarInt();
|
||||
assert($count === $this->width * $this->height);
|
||||
if($count !== $this->width * $this->height){
|
||||
throw new \UnexpectedValueException("Expected colour count of " . ($this->height * $this->width) . " (height $this->height * width $this->width), got $count");
|
||||
}
|
||||
|
||||
for($y = 0; $y < $this->height; ++$y){
|
||||
for($x = 0; $x < $this->width; ++$x){
|
||||
|
Reference in New Issue
Block a user