forked from mirror/openmw-tes3mp
Merge remote-tracking branch 'scrawl/tradefix'
This commit is contained in:
commit
9835c6df11
1 changed files with 8 additions and 4 deletions
|
@ -288,8 +288,10 @@ namespace MWGui
|
||||||
int a = abs(mCurrentMerchantOffer);
|
int a = abs(mCurrentMerchantOffer);
|
||||||
int b = abs(mCurrentBalance);
|
int b = abs(mCurrentBalance);
|
||||||
int d = 0;
|
int d = 0;
|
||||||
if (mCurrentMerchantOffer<0) d = int(100 * (a - b) / a);
|
if (mCurrentBalance<0)
|
||||||
else d = int(100 * (b - a) / a);
|
d = int(100 * (a - b) / a);
|
||||||
|
else
|
||||||
|
d = int(100 * (b - a) / a);
|
||||||
|
|
||||||
float clampedDisposition = std::max<int>(0,std::min<int>(int(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr)
|
float clampedDisposition = std::max<int>(0,std::min<int>(int(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr)
|
||||||
+ MWBase::Environment::get().getDialogueManager()->getTemporaryDispositionChange()),100));
|
+ MWBase::Environment::get().getDialogueManager()->getTemporaryDispositionChange()),100));
|
||||||
|
@ -310,8 +312,10 @@ namespace MWGui
|
||||||
float pcTerm = (clampedDisposition - 50 + a1 + b1 + c1) * playerStats.getFatigueTerm();
|
float pcTerm = (clampedDisposition - 50 + a1 + b1 + c1) * playerStats.getFatigueTerm();
|
||||||
float npcTerm = (d1 + e1 + f1) * sellerStats.getFatigueTerm();
|
float npcTerm = (d1 + e1 + f1) * sellerStats.getFatigueTerm();
|
||||||
float x = gmst.find("fBargainOfferMulti")->getFloat() * d + gmst.find("fBargainOfferBase")->getFloat();
|
float x = gmst.find("fBargainOfferMulti")->getFloat() * d + gmst.find("fBargainOfferBase")->getFloat();
|
||||||
if (mCurrentMerchantOffer<0) x += abs(int(pcTerm - npcTerm));
|
if (mCurrentBalance<0)
|
||||||
else x += abs(int(npcTerm - pcTerm));
|
x += abs(int(pcTerm - npcTerm));
|
||||||
|
else
|
||||||
|
x += abs(int(npcTerm - pcTerm));
|
||||||
|
|
||||||
int roll = std::rand()%100 + 1;
|
int roll = std::rand()%100 + 1;
|
||||||
if(roll > x) //trade refused
|
if(roll > x) //trade refused
|
||||||
|
|
Loading…
Reference in a new issue