mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Make sure it's a crime to unlock owned doors
This commit is contained in:
parent
74c121a69d
commit
f79e20379b
2 changed files with 11 additions and 5 deletions
|
@ -43,6 +43,8 @@ namespace MWMechanics
|
|||
x *= pickQuality * mFatigueTerm;
|
||||
x += fPickLockMult * lockStrength;
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, lock);
|
||||
|
||||
resultSound = "Open Lock Fail";
|
||||
if (x <= 0)
|
||||
resultMessage = "#{sLockImpossible}";
|
||||
|
@ -59,7 +61,6 @@ namespace MWMechanics
|
|||
resultMessage = "#{sLockFail}";
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, lock);
|
||||
int uses = lockpick.getClass().getItemHealth(lockpick);
|
||||
--uses;
|
||||
lockpick.getCellRef().setCharge(uses);
|
||||
|
@ -84,6 +85,8 @@ namespace MWMechanics
|
|||
x += fTrapCostMult * trapSpellPoints;
|
||||
x *= probeQuality * mFatigueTerm;
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, trap);
|
||||
|
||||
resultSound = "Disarm Trap Fail";
|
||||
if (x <= 0)
|
||||
resultMessage = "#{sTrapImpossible}";
|
||||
|
@ -101,7 +104,6 @@ namespace MWMechanics
|
|||
resultMessage = "#{sTrapFail}";
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, trap);
|
||||
int uses = probe.getClass().getItemHealth(probe);
|
||||
--uses;
|
||||
probe.getCellRef().setCharge(uses);
|
||||
|
|
|
@ -709,6 +709,11 @@ namespace MWMechanics
|
|||
}
|
||||
else if (effectId == ESM::MagicEffect::Open)
|
||||
{
|
||||
if (!caster.isEmpty())
|
||||
{
|
||||
MWBase::Environment::get().getMechanicsManager()->unlockAttempted(getPlayer(), target);
|
||||
// Use the player instead of the caster for vanilla crime compatibility
|
||||
}
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::MagicEffect *magiceffect = store.get<ESM::MagicEffect>().find(effectId);
|
||||
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target);
|
||||
|
@ -726,11 +731,10 @@ namespace MWMechanics
|
|||
target.getCellRef().unlock();
|
||||
}
|
||||
else
|
||||
{
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock Fail", 1.f, 1.f);
|
||||
}
|
||||
|
||||
if (!caster.isEmpty())
|
||||
MWBase::Environment::get().getMechanicsManager()->unlockAttempted(getPlayer(), target);
|
||||
// Use the player instead of the caster for vanilla crime compatibility
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue