diff options
Diffstat (limited to 'src/Entities')
-rw-r--r-- | src/Entities/Player.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 7232ed614..761337a30 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -976,6 +976,18 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) AddFoodExhaustion(0.3f); SendHealth(); + // Damage armor + short ArmorDamage = static_cast<short>(a_TDI.RawDamage / 4); + if (ArmorDamage == 0) + { + ArmorDamage = 1; + } + m_Inventory.DamageItem(cInventory::invArmorOffset + 0, ArmorDamage); + m_Inventory.DamageItem(cInventory::invArmorOffset + 1, ArmorDamage); + m_Inventory.DamageItem(cInventory::invArmorOffset + 2, ArmorDamage); + m_Inventory.DamageItem(cInventory::invArmorOffset + 3, ArmorDamage); + + // Tell the wolves if (a_TDI.Attacker != nullptr) { if (a_TDI.Attacker->IsPawn()) |