forked from mirror/openmw-tes3mp
Make sure crime gold discounts don't reduce price to zero
This commit is contained in:
parent
1320ac6983
commit
63fd04882a
1 changed files with 7 additions and 1 deletions
|
@ -2586,9 +2586,15 @@ namespace MWWorld
|
|||
float fCrimeGoldDiscountMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldDiscountMult")->getFloat();
|
||||
float fCrimeGoldTurnInMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldTurnInMult")->getFloat();
|
||||
|
||||
int discount = bounty*fCrimeGoldDiscountMult;
|
||||
int discount = bounty * fCrimeGoldDiscountMult;
|
||||
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["pchasgolddiscount"].setInteger((discount <= playerGold) ? 1 : 0);
|
||||
|
|
Loading…
Reference in a new issue