forked from mirror/openmw-tes3mp
Fix attempting to access NPC stats on creatures
This commit is contained in:
parent
d18c86ec2d
commit
5e992a0342
1 changed files with 5 additions and 5 deletions
|
@ -448,14 +448,14 @@ namespace MWDialogue
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
|
||||||
|
|
||||||
|
// Apply disposition change to NPC's base disposition
|
||||||
|
if (mActor.getClass().isNpc())
|
||||||
|
{
|
||||||
// Clamp permanent disposition change so that final disposition doesn't go below 0 (could happen with intimidate)
|
// Clamp permanent disposition change so that final disposition doesn't go below 0 (could happen with intimidate)
|
||||||
float curDisp = static_cast<float>(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mActor, false));
|
float curDisp = static_cast<float>(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mActor, false));
|
||||||
if (curDisp + mPermanentDispositionChange < 0)
|
if (curDisp + mPermanentDispositionChange < 0)
|
||||||
mPermanentDispositionChange = -curDisp;
|
mPermanentDispositionChange = -curDisp;
|
||||||
|
|
||||||
// Apply disposition change to NPC's base disposition
|
|
||||||
if (mActor.getClass().isNpc())
|
|
||||||
{
|
|
||||||
MWMechanics::NpcStats& npcStats = mActor.getClass().getNpcStats(mActor);
|
MWMechanics::NpcStats& npcStats = mActor.getClass().getNpcStats(mActor);
|
||||||
npcStats.setBaseDisposition(static_cast<int>(npcStats.getBaseDisposition() + mPermanentDispositionChange));
|
npcStats.setBaseDisposition(static_cast<int>(npcStats.getBaseDisposition() + mPermanentDispositionChange));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue