summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Nykolenko <artemnykolenko@gmail.com>2022-01-16 10:15:47 +0000
committerpsi29a <psi29a@gmail.com>2022-01-16 10:15:47 +0000
commita5cdc889a2d128172b853019f416c5487831fe0c (patch)
tree62c54d14b5d840af70e6de3f23f0453b843551e3
parent98d15884779ff6792acacf1a024a38cdaf4daeb9 (diff)
#6303 Made player stop attacking and sheathe weapon when going to jail
-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 325e048958..9cf60f7dc5 100644
--- a/apps/openmw/mwworld/worldimp.cpp
+++ b/apps/openmw/mwworld/worldimp.cpp
@@ -3621,14 +3621,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();
@@ -3641,6 +3640,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);