mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:53:52 +00:00
Merge pull request #2380 from Capostrophic/faction
Allow scripted faction leaving using PCLowerRank (feature #5036)
This commit is contained in:
commit
55767eaf7e
2 changed files with 7 additions and 1 deletions
|
@ -115,6 +115,7 @@
|
|||
Feature #5010: Native graphics herbalism support
|
||||
Feature #5031: Make GetWeaponType function return different values for tools
|
||||
Feature #5033: Magic armor mitigation for creatures
|
||||
Feature #5036: Allow scripted faction leaving
|
||||
Task #4686: Upgrade media decoder to a more current FFmpeg API
|
||||
Task #4695: Optimize Distant Terrain memory consumption
|
||||
Task #4721: Add NMake support to the Windows prebuild script
|
||||
|
|
|
@ -85,7 +85,12 @@ void MWMechanics::NpcStats::lowerRank(const std::string &faction)
|
|||
std::map<std::string, int>::iterator it = mFactionRank.find(lower);
|
||||
if (it != mFactionRank.end())
|
||||
{
|
||||
it->second = std::max(0, it->second-1);
|
||||
it->second = it->second-1;
|
||||
if (it->second < 0)
|
||||
{
|
||||
mFactionRank.erase(it);
|
||||
mExpelled.erase(lower);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue