1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 04:39:42 +00:00

Merge branch 'double_float_conv' into 'master'

Fix unnecessary float-to-double promotion

See merge request OpenMW/openmw!1532
This commit is contained in:
Evil Eye 2022-01-04 22:01:53 +00:00
commit c3d3535ffd
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);