diff options
author | Aplaus228 <33102433+Aplaus228@users.noreply.github.com> | 2019-08-08 12:51:38 +0200 |
---|---|---|
committer | peterbell10 <peterbell10@live.co.uk> | 2019-08-08 12:51:38 +0200 |
commit | 466d986e5e7a01679e70a7affd5beaba401ae305 (patch) | |
tree | ef6ff0950dae65b531e4539abe55e0089444b3ff /src/Entities/Entity.cpp | |
parent | Fixed compilation on VS2019 (diff) | |
download | cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.tar cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.tar.gz cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.tar.bz2 cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.tar.lz cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.tar.xz cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.tar.zst cuberite-466d986e5e7a01679e70a7affd5beaba401ae305.zip |
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r-- | src/Entities/Entity.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index c0c381d41..7546cc402 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -319,7 +319,7 @@ void cEntity::TakeDamage(eDamageType a_DamageType, UInt32 a_AttackerID, int a_Ra -void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount) +void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, float a_FinalDamage, double a_KnockbackAmount) { TakeDamageInfo TDI; TDI.DamageType = a_DamageType; @@ -427,7 +427,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) if (SharpnessLevel > 0) { - a_TDI.FinalDamage += static_cast<int>(ceil(1.25 * SharpnessLevel)); + a_TDI.FinalDamage += 1.25 * SharpnessLevel; } else if (SmiteLevel > 0) { @@ -441,7 +441,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) case mtWither: case mtZombiePigman: { - a_TDI.FinalDamage += static_cast<int>(ceil(2.5 * SmiteLevel)); + a_TDI.FinalDamage += 2.5 * SmiteLevel; break; } default: break; @@ -459,7 +459,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) case mtCaveSpider: case mtSilverfish: { - a_TDI.FinalDamage += static_cast<int>(ceil(2.5 * BaneOfArthropodsLevel)); + a_TDI.FinalDamage += 2.5 * BaneOfArthropodsLevel; // The duration of the effect is a random value between 1 and 1.5 seconds at level I, // increasing the max duration by 0.5 seconds each level // Ref: https://minecraft.gamepedia.com/Enchanting#Bane_of_Arthropods @@ -525,7 +525,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) Player->GetStatManager().AddValue(statDamageDealt, static_cast<StatValue>(floor(a_TDI.FinalDamage * 10 + 0.5))); } - m_Health -= static_cast<float>(a_TDI.FinalDamage); + m_Health -= a_TDI.FinalDamage; m_Health = std::max(m_Health, 0.0f); // Add knockback: |