1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Fix unnecessary float-to-double promotion

This commit is contained in:
jvoisin 2022-01-04 22:01:52 +00:00 committed by Evil Eye
parent 0eed275b74
commit 27af776735
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ namespace MWMechanics
float max = getFatigue().getModified();
float current = getFatigue().getCurrent();
float normalised = floor(max) == 0 ? 1 : std::max (0.0f, current / max);
float normalised = std::floor(max) == 0 ? 1 : std::max (0.0f, current / max);
const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();

View File

@ -71,10 +71,10 @@ namespace MWMechanics
int initialMerchantOffer = std::abs(merchantOffer);
if ( !buying && (finalPrice > initialMerchantOffer) ) {
skillGain = floor(100.f * (finalPrice - initialMerchantOffer) / finalPrice);
skillGain = std::floor(100.f * (finalPrice - initialMerchantOffer) / finalPrice);
}
else if ( buying && (finalPrice < initialMerchantOffer) ) {
skillGain = floor(100.f * (initialMerchantOffer - finalPrice) / initialMerchantOffer);
skillGain = std::floor(100.f * (initialMerchantOffer - finalPrice) / initialMerchantOffer);
}
player.getClass().skillUsageSucceeded(player, ESM::Skill::Mercantile, 0, skillGain);