1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-30 07:21:12 +00:00

Merge branch '6303-jail-stuck-attack' into 'master'

#6303 Made player stop attacking and sheathe weapon when going to jail

See merge request OpenMW/openmw!1551
This commit is contained in:
psi29a 2022-01-16 10:15:47 +00:00
commit fd7e0b74cc
2 changed files with 8 additions and 2 deletions

View File

@ -72,6 +72,7 @@
Bug #6289: Keyword search in dialogues expected the text to be all ASCII characters
Bug #6291: Can't pickup the dead mage's journal from the mysterious hunter mod
Bug #6302: Teleporting disabled actor breaks its disabled state
Bug #6303: After "go to jail" weapon can stuck in the ready to attack state
Bug #6307: Pathfinding in Infidelities quest from Tribunal addon is broken
Bug #6321: Arrow enchantments should always be applied to the target
Bug #6322: Total sold/cost should reset to 0 when there are no items offered

View File

@ -3620,14 +3620,13 @@ namespace MWWorld
void World::goToJail()
{
const MWWorld::Ptr player = getPlayerPtr();
if (!mGoToJail)
{
// Reset bounty and forget the crime now, but don't change cell yet (the player should be able to read the dialog text first)
mGoToJail = true;
mPlayerInJail = true;
MWWorld::Ptr player = getPlayerPtr();
int bounty = player.getClass().getNpcStats(player).getBounty();
player.getClass().getNpcStats(player).setBounty(0);
mPlayer->recordCrimeId();
@ -3640,6 +3639,12 @@ namespace MWWorld
}
else
{
if (MWBase::Environment::get().getMechanicsManager()->isAttackPreparing(player))
{
mPlayer->setAttackingOrSpell(false);
}
mPlayer->setDrawState(MWMechanics::DrawState_Nothing);
mGoToJail = false;
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);