mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Expell player from faction when committing a crime against a faction member
This commit is contained in:
parent
19d63f392f
commit
9baa1bef78
@ -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…
x
Reference in New Issue
Block a user