Merge pull request #2380 from Capostrophic/faction

Allow scripted faction leaving using PCLowerRank (feature #5036)
pull/2385/head
Andrei Kortunov 6 years ago committed by GitHub
commit 55767eaf7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save