Fixed comparing int32_t with uint32_t.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-06-10 14:46:45 +02:00
parent c8314d6018
commit 3358bf7378
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ void Battling::Creature::ChangeVariant(ArbUt::BorrowedPtr<const Library::Species
auto prevHealth = GetBoostedStat(CreatureLib::Library::Statistic::Health); auto prevHealth = GetBoostedStat(CreatureLib::Library::Statistic::Health);
RecalculateFlatStats(); RecalculateFlatStats();
int32_t diffHealth = GetBoostedStat(CreatureLib::Library::Statistic::Health) - prevHealth; int32_t diffHealth = GetBoostedStat(CreatureLib::Library::Statistic::Health) - prevHealth;
if (_currentHealth < -diffHealth) { if (_currentHealth < static_cast<uint32_t>(INT32_MAX) && static_cast<int32_t>(_currentHealth) < -diffHealth) {
_currentHealth = 0; _currentHealth = 0;
} else { } else {
_currentHealth += diffHealth; _currentHealth += diffHealth;