Make sure failed pick/trap attempts are a crime (bug #5149)

pull/2513/head
Capostrophic 5 years ago
parent 2daecc633e
commit 8317dc0709

@ -135,6 +135,7 @@
Bug #5126: Swimming creatures without RunForward animations are motionless during combat
Bug #5134: Doors rotation by "Lock" console command is inconsistent
Bug #5137: Textures with Clamp Mode set to Clamp instead of Wrap are too dark outside the boundaries
Bug #5149: Failing lock pick attempts isn't always a crime
Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI
Feature #3025: Analogue gamepad movement controls

@ -48,7 +48,6 @@ namespace MWMechanics
resultMessage = "#{sLockImpossible}";
else
{
MWBase::Environment::get().getMechanicsManager()->objectOpened(mActor, lock);
if (Misc::Rng::roll0to99() <= x)
{
lock.getClass().unlock(lock);
@ -60,6 +59,7 @@ namespace MWMechanics
resultMessage = "#{sLockFail}";
}
MWBase::Environment::get().getMechanicsManager()->objectOpened(mActor, lock);
int uses = lockpick.getClass().getItemHealth(lockpick);
--uses;
lockpick.getCellRef().setCharge(uses);
@ -89,7 +89,6 @@ namespace MWMechanics
resultMessage = "#{sTrapImpossible}";
else
{
MWBase::Environment::get().getMechanicsManager()->objectOpened(mActor, trap);
if (Misc::Rng::roll0to99() <= x)
{
trap.getCellRef().setTrap("");
@ -102,6 +101,7 @@ namespace MWMechanics
resultMessage = "#{sTrapFail}";
}
MWBase::Environment::get().getMechanicsManager()->objectOpened(mActor, trap);
int uses = probe.getClass().getItemHealth(probe);
--uses;
probe.getCellRef().setCharge(uses);

@ -712,9 +712,6 @@ namespace MWMechanics
if (target.getCellRef().getLockLevel() > 0)
{
MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f);
if (!caster.isEmpty())
MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target);
// Use the player instead of the caster for vanilla crime compatibility
if (caster == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}");
@ -723,6 +720,11 @@ namespace MWMechanics
}
else
MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock Fail", 1.f, 1.f);
// Failed attempt is a crime too
if (!caster.isEmpty())
MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target);
// Use the player instead of the caster for vanilla crime compatibility
return true;
}
}

Loading…
Cancel
Save