Make sure crime gold discounts don't reduce price to zero

This commit is contained in:
scrawl 2014-07-19 23:49:54 +02:00
parent 1320ac6983
commit 63fd04882a

View file

@ -2589,6 +2589,12 @@ namespace MWWorld
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);