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:
parent
0eed275b74
commit
27af776735
@ -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…
x
Reference in New Issue
Block a user