From b62b0a2f00ae4e6cb98d93195500a5a78c7917b6 Mon Sep 17 00:00:00 2001 From: Zackhasacat Date: Wed, 15 May 2024 11:56:58 -0500 Subject: [PATCH] Check for world AI disable --- apps/openmw/mwmechanics/character.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index cbe23299cc..1791bb94c8 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1647,12 +1647,13 @@ namespace MWMechanics std::string stopKey = "stop"; MWBase::LuaManager::ActorControls* actorControls = MWBase::Environment::get().getLuaManager()->getActorControls(mPtr); - + const bool aiInactive + = actorControls->mDisableAI || !MWBase::Environment::get().getMechanicsManager()->isAIActive(); if (mWeaponType != ESM::Weapon::PickProbe && !isRandomAttackAnimation(mCurrentWeapon)) { if (weapclass == ESM::WeaponType::Ranged || weapclass == ESM::WeaponType::Thrown) mAttackType = "shoot"; - else if (mPtr == getPlayer() || actorControls->mDisableAI) + else if (mPtr == getPlayer() || aiInactive) { if (Settings::game().mBestAttack) {