1
0
Fork 0
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:
Andrei Kortunov 2019-05-13 21:21:47 +04:00 committed by GitHub
commit 55767eaf7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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);
}
}
}