mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +00:00
Make sure crime gold discounts don't reduce price to zero
This commit is contained in:
parent
1320ac6983
commit
63fd04882a
@ -2586,9 +2586,15 @@ namespace MWWorld
|
|||||||
float fCrimeGoldDiscountMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldDiscountMult")->getFloat();
|
float fCrimeGoldDiscountMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldDiscountMult")->getFloat();
|
||||||
float fCrimeGoldTurnInMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldTurnInMult")->getFloat();
|
float fCrimeGoldTurnInMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldTurnInMult")->getFloat();
|
||||||
|
|
||||||
int discount = bounty*fCrimeGoldDiscountMult;
|
int discount = bounty * fCrimeGoldDiscountMult;
|
||||||
int turnIn = bounty * fCrimeGoldTurnInMult;
|
int turnIn = bounty * fCrimeGoldTurnInMult;
|
||||||
|
|
||||||
|
if (bounty > 0)
|
||||||
|
{
|
||||||
|
discount = std::max(1, discount);
|
||||||
|
turnIn = std::max(1, turnIn);
|
||||||
|
}
|
||||||
|
|
||||||
mGlobalVariables["pchascrimegold"].setInteger((bounty <= playerGold) ? 1 : 0);
|
mGlobalVariables["pchascrimegold"].setInteger((bounty <= playerGold) ? 1 : 0);
|
||||||
|
|
||||||
mGlobalVariables["pchasgolddiscount"].setInteger((discount <= playerGold) ? 1 : 0);
|
mGlobalVariables["pchasgolddiscount"].setInteger((discount <= playerGold) ? 1 : 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user