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:
commit
c3d3535ffd
2 changed files with 3 additions and 3 deletions
|
@ -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>();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue