1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-19 19:09:49 +00:00

Correct selling prices of creature merchants

This commit is contained in:
Alexei Dobrohotov 2019-05-19 23:43:40 +03:00 committed by GitHub
parent c66ddea429
commit 0ee73d89f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -484,7 +484,7 @@ namespace MWGui
const int basePrice = getEffectiveValue(itemStack.mBase, itemStack.mCount);
const int cap = static_cast<int>(std::max(1.f, 0.75f * basePrice)); // Maximum selling price -- 75% of the base
const int sellingPrice = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, basePrice, false);
merchantOffer += std::min(cap, sellingPrice);
merchantOffer += mPtr.getClass().isNpc() ? std::min(cap, sellingPrice) : sellingPrice;
}
int diff = merchantOffer - mCurrentMerchantOffer;