forked from mirror/openmw-tes3mp
Make trade disposition changes temporary again, as in vanilla
This commit is contained in:
parent
a1bdf20958
commit
865486604f
3 changed files with 4 additions and 10 deletions
|
@ -61,6 +61,8 @@ namespace MWBase
|
|||
|
||||
virtual void persuade (int type) = 0;
|
||||
virtual int getTemporaryDispositionChange () const = 0;
|
||||
|
||||
/// @note This change is temporary and gets discarded when dialogue ends.
|
||||
virtual void applyDispositionChange (int delta) = 0;
|
||||
|
||||
virtual int countSavedGameRecords() const = 0;
|
||||
|
|
|
@ -560,17 +560,7 @@ namespace MWDialogue
|
|||
|
||||
void DialogueManager::applyDispositionChange(int delta)
|
||||
{
|
||||
int oldTemp = mTemporaryDispositionChange;
|
||||
mTemporaryDispositionChange += delta;
|
||||
// don't allow increasing beyond 100 or decreasing below 0
|
||||
int curDisp = MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mActor);
|
||||
if (curDisp + mTemporaryDispositionChange < 0)
|
||||
mTemporaryDispositionChange = -curDisp;
|
||||
else if (curDisp + mTemporaryDispositionChange > 100)
|
||||
mTemporaryDispositionChange = 100 - curDisp;
|
||||
|
||||
int diff = mTemporaryDispositionChange - oldTemp;
|
||||
mPermanentDispositionChange += diff;
|
||||
}
|
||||
|
||||
bool DialogueManager::checkServiceRefused()
|
||||
|
|
|
@ -84,6 +84,8 @@ namespace MWDialogue
|
|||
|
||||
virtual void persuade (int type);
|
||||
virtual int getTemporaryDispositionChange () const;
|
||||
|
||||
/// @note This change is temporary and gets discarded when dialogue ends.
|
||||
virtual void applyDispositionChange (int delta);
|
||||
|
||||
virtual int countSavedGameRecords() const;
|
||||
|
|
Loading…
Reference in a new issue