mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +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;
|
$equipment[$mainHandIndex] = $item;
|
||||||
}
|
}
|
||||||
//TODO: check offhand
|
//TODO: check offhand
|
||||||
foreach($this->armorInventory->getContents() as $k => $item){
|
foreach($this->armorInventory->getContents() as $k => $armorItem){
|
||||||
if($item instanceof Durable and $item->hasEnchantment(Enchantment::MENDING)){
|
if($armorItem instanceof Durable and $armorItem->hasEnchantment(Enchantment::MENDING)){
|
||||||
$equipment[$k] = $item;
|
$equipment[$k] = $armorItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user