Fixed possible out-of-bounds access on corrupted playerdata when loading inventory contents

This commit is contained in:
Dylan K. Taylor 2019-07-06 19:39:07 +01:00
parent f714ed6e90
commit 77a4393c7b

View File

@ -628,7 +628,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
//Old hotbar saving stuff, ignore it
}elseif($slot >= 100 and $slot < 104){ //Armor
$this->armorInventory->setItem($slot - 100, Item::nbtDeserialize($item));
}else{
}elseif($slot >= 9 and $slot < $this->inventory->getSize() + 9){
$this->inventory->setItem($slot - 9, Item::nbtDeserialize($item));
}
}