diff options
Diffstat (limited to 'src/Entities')
-rw-r--r-- | src/Entities/Entity.cpp | 4 | ||||
-rw-r--r-- | src/Entities/Pawn.cpp | 2 | ||||
-rw-r--r-- | src/Entities/Player.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 55f5ba144..efeff5d66 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -288,7 +288,7 @@ void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_R } ApplyArmorDamage(ArmorCover); - cEntity::TakeDamage(a_DamageType, a_Attacker, a_RawDamage, FinalDamage, a_KnockbackAmount); + cEntity::TakeDamage(a_DamageType, a_Attacker, a_RawDamage, static_cast<float>(FinalDamage), a_KnockbackAmount); } @@ -518,7 +518,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) if (Random.RandBool(Chance / 100.0)) { - a_TDI.Attacker->TakeDamage(dtAttack, this, 0, Random.RandInt(1, 4), 0); + a_TDI.Attacker->TakeDamage(dtAttack, this, 0, Random.RandReal(1.0f, 4.0f), 0); } } diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index ba91258e9..11c7999c9 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -425,7 +425,7 @@ void cPawn::HandleFalling(void) auto Damage = static_cast<int>(m_LastGroundHeight - GetPosY() - 3.0); if ((Damage > 0) && !FallDamageAbsorbed) { - TakeDamage(dtFalling, nullptr, Damage, Damage, 0); + TakeDamage(dtFalling, nullptr, Damage, static_cast<float>(Damage), 0); // Fall particles GetWorld()->BroadcastParticleEffect( diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 050b4adb9..e7b6ade15 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -2209,7 +2209,7 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World) SetRoll (static_cast<float>(JSON_PlayerRotation[2].asDouble())); } - m_Health = root.get("health", 0).asInt(); + m_Health = root.get("health", 0).asFloat(); m_AirLevel = root.get("air", MAX_AIR_LEVEL).asInt(); m_FoodLevel = root.get("food", MAX_FOOD_LEVEL).asInt(); m_FoodSaturationLevel = root.get("foodSaturation", MAX_FOOD_LEVEL).asDouble(); |