summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsi29a <psi29a@gmail.com>2022-01-16 10:15:47 +0000
committerpsi29a <psi29a@gmail.com>2022-01-16 10:15:47 +0000
commitfd7e0b74cc640c42d7b121da5fba0d7ec1c240f0 (patch)
treeeb405269ff4684c511f344df807bd5dc23642d93
parentc07fb75bf7b02400a3a4648bb9924823de93a968 (diff)
parenta5cdc889a2d128172b853019f416c5487831fe0c (diff)
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
-rw-r--r--CHANGELOG.md1
-rw-r--r--apps/openmw/mwworld/worldimp.cpp9
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4165c7d579..9c45d15e6d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp
index f6e00d3e21..501378d7cc 100644
--- a/apps/openmw/mwworld/worldimp.cpp
+++ b/apps/openmw/mwworld/worldimp.cpp
@@ -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);