mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Human: avoid overwriting non-foreach vars in foreach
This commit is contained in:
parent
c43e21235d
commit
88afedd1e8
@ -489,9 +489,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$equipment[$mainHandIndex] = $item;
|
||||
}
|
||||
//TODO: check offhand
|
||||
foreach($this->armorInventory->getContents() as $k => $item){
|
||||
if($item instanceof Durable and $item->hasEnchantment(Enchantment::MENDING)){
|
||||
$equipment[$k] = $item;
|
||||
foreach($this->armorInventory->getContents() as $k => $armorItem){
|
||||
if($armorItem instanceof Durable and $armorItem->hasEnchantment(Enchantment::MENDING)){
|
||||
$equipment[$k] = $armorItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user