From 315ad54b29c9e0382db26e541b42940dfff1fa5f Mon Sep 17 00:00:00 2001 From: Allofich Date: Mon, 8 May 2017 19:55:54 +0900 Subject: [PATCH] Don't make NPCs or player speak while underwater (Fixes #3851) --- apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index c853efad2..38ad821cd 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -633,6 +633,12 @@ namespace MWDialogue return; } + if (actor.getClass().isNpc() && MWBase::Environment::get().getWorld()->isSwimming(actor)) + { + // NPCs don't talk while submerged + return; + } + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Dialogue *dial = store.get().find(topic);