forked from mirror/openmw-tes3mp
Implement Rank filter with no faction given (Fixes #1660)
This commit is contained in:
parent
4d39d77eaa
commit
d4ffd30f98
1 changed files with 12 additions and 2 deletions
|
@ -76,8 +76,18 @@ bool MWDialogue::Filter::testActor (const ESM::DialInfo& info) const
|
||||||
}
|
}
|
||||||
else if (info.mData.mRank != -1)
|
else if (info.mData.mRank != -1)
|
||||||
{
|
{
|
||||||
// if there is a rank condition, but the NPC is not in a faction, always fail
|
if (isCreature)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Rank requirement, but no faction given. Use the actor's faction, if there is one.
|
||||||
|
MWMechanics::NpcStats& stats = mActor.getClass().getNpcStats (mActor);
|
||||||
|
|
||||||
|
if (!stats.getFactionRanks().size())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// check rank
|
||||||
|
if (stats.getFactionRanks().begin()->second < info.mData.mRank)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gender
|
// Gender
|
||||||
|
|
Loading…
Reference in a new issue