diff --git a/src/Battling/Library/DamageLibrary.cpp b/src/Battling/Library/DamageLibrary.cpp index 12787d6..12f67ec 100644 --- a/src/Battling/Library/DamageLibrary.cpp +++ b/src/Battling/Library/DamageLibrary.cpp @@ -34,7 +34,7 @@ uint32_t PkmnLib::Battling::DamageLibrary::GetDamage(CreatureLib::Battling::Exec if (_hasRandomness) { Ensure(attack->GetUser()->GetBattle().GetValue()); float randPercentage = 85 + attack->GetUser()->GetBattle().GetValue()->GetRandom()->Get(0, 16); - floatDamage = fl(floatDamage * (randPercentage / 100.0)); + floatDamage = fl(floatDamage * (randPercentage / 100.0f)); } if (attack->GetUser()->HasType(hitData.GetType())) { @@ -46,8 +46,12 @@ uint32_t PkmnLib::Battling::DamageLibrary::GetDamage(CreatureLib::Battling::Exec floatDamage = fl(floatDamage * hitData.GetEffectiveness()); uint32_t damage = 0; - if (floatDamage < 0) { - damage = 0; + if (floatDamage <= 0) { + if (hitData.GetEffectiveness() == 0) { + damage = 0; + } else { + damage = 1; + } } else if (floatDamage >= (float)UINT32_MAX) { damage = UINT32_MAX; } else {