forked from mirror/openmw-tes3mp
Expell player from faction when committing a crime against a faction member
This commit is contained in:
parent
19d63f392f
commit
9baa1bef78
2 changed files with 13 additions and 1 deletions
|
@ -255,7 +255,7 @@ namespace MWGui
|
||||||
if (pickpocket.finish())
|
if (pickpocket.finish())
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getMechanicsManager()->reportCrime(
|
MWBase::Environment::get().getMechanicsManager()->reportCrime(
|
||||||
player, MWWorld::Ptr(), MWBase::MechanicsManager::OT_Pickpocket);
|
player, mPtr, MWBase::MechanicsManager::OT_Pickpocket);
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
|
||||||
MWBase::Environment::get().getDialogueManager()->say(mPtr, "Thief");
|
MWBase::Environment::get().getDialogueManager()->say(mPtr, "Thief");
|
||||||
mPickpocketDetected = true;
|
mPickpocketDetected = true;
|
||||||
|
|
|
@ -829,6 +829,18 @@ namespace MWMechanics
|
||||||
ptr.getClass().getNpcStats(ptr).setBounty(ptr.getClass().getNpcStats(ptr).getBounty()
|
ptr.getClass().getNpcStats(ptr).setBounty(ptr.getClass().getNpcStats(ptr).getBounty()
|
||||||
+ arg);
|
+ arg);
|
||||||
|
|
||||||
|
// If committing a crime against a faction member, expell from the faction
|
||||||
|
if (!victim.isEmpty() && victim.getClass().isNpc())
|
||||||
|
{
|
||||||
|
std::string factionID;
|
||||||
|
if(!victim.getClass().getNpcStats(victim).getFactionRanks().empty())
|
||||||
|
factionID = victim.getClass().getNpcStats(victim).getFactionRanks().begin()->first;
|
||||||
|
if (ptr.getClass().getNpcStats(ptr).isSameFaction(victim.getClass().getNpcStats(victim)))
|
||||||
|
{
|
||||||
|
ptr.getClass().getNpcStats(ptr).expell(factionID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: make any guards in the area try to arrest the player
|
// TODO: make any guards in the area try to arrest the player
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue