Fixed totem activating when having 1HP instead of 0HP (#5380)

This commit is contained in:
Javier León
2022-11-07 10:54:14 -03:00
committed by GitHub
parent 1a8c8af523
commit 3a2a23b236

View File

@ -356,7 +356,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
&& ($this->inventory->getItemInHand() instanceof Totem || $this->offHandInventory->getItem(0) instanceof Totem)){
$compensation = $this->getHealth() - $source->getFinalDamage() - 1;
if($compensation < 0){
if($compensation <= -1){
$source->setModifier($compensation, EntityDamageEvent::MODIFIER_TOTEM);
}
}