1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-10 15:45:37 +00:00

Merge branch 'fargothsayshello' into 'master'

Don't turn to face the player to say hello if there is no hello response

Closes #8132

See merge request OpenMW/openmw!4339
This commit is contained in:
psi29a 2024-08-27 15:38:25 +00:00
commit 24a0e42594
5 changed files with 10 additions and 7 deletions

View File

@ -190,6 +190,7 @@
Bug #8085: Don't search in scripts or shaders directories for "Select directories you wish to add" menu in launcher Bug #8085: Don't search in scripts or shaders directories for "Select directories you wish to add" menu in launcher
Bug #8097: GetEffect doesn't detect 0 magnitude spells Bug #8097: GetEffect doesn't detect 0 magnitude spells
Bug #8124: Normal weapon resistance is applied twice for NPCs Bug #8124: Normal weapon resistance is applied twice for NPCs
Bug #8132: Actors without hello responses turn to face the player
Feature #1415: Infinite fall failsafe Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

View File

@ -66,7 +66,7 @@ namespace MWBase
virtual void goodbye() = 0; virtual void goodbye() = 0;
virtual void say(const MWWorld::Ptr& actor, const ESM::RefId& topic) = 0; virtual bool say(const MWWorld::Ptr& actor, const ESM::RefId& topic) = 0;
virtual void keywordSelected(std::string_view keyword, ResponseCallback* callback) = 0; virtual void keywordSelected(std::string_view keyword, ResponseCallback* callback) = 0;
virtual void goodbyeSelected() = 0; virtual void goodbyeSelected() = 0;

View File

@ -620,25 +620,25 @@ namespace MWDialogue
return false; return false;
} }
void DialogueManager::say(const MWWorld::Ptr& actor, const ESM::RefId& topic) bool DialogueManager::say(const MWWorld::Ptr& actor, const ESM::RefId& topic)
{ {
MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager(); MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager();
if (sndMgr->sayActive(actor)) if (sndMgr->sayActive(actor))
{ {
// Actor is already saying something. // Actor is already saying something.
return; return false;
} }
if (actor.getClass().isNpc() && MWBase::Environment::get().getWorld()->isSwimming(actor)) if (actor.getClass().isNpc() && MWBase::Environment::get().getWorld()->isSwimming(actor))
{ {
// NPCs don't talk while submerged // NPCs don't talk while submerged
return; return false;
} }
if (actor.getClass().getCreatureStats(actor).getKnockedDown()) if (actor.getClass().getCreatureStats(actor).getKnockedDown())
{ {
// Unconscious actors can not speak // Unconscious actors can not speak
return; return false;
} }
const MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore(); const MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore();
@ -657,6 +657,7 @@ namespace MWDialogue
if (!info->mResultScript.empty()) if (!info->mResultScript.empty())
executeScript(info->mResultScript, actor); executeScript(info->mResultScript, actor);
} }
return info != nullptr;
} }
int DialogueManager::countSavedGameRecords() const int DialogueManager::countSavedGameRecords() const

View File

@ -100,7 +100,7 @@ namespace MWDialogue
bool checkServiceRefused(ResponseCallback* callback, ServiceType service = ServiceType::Any) override; bool checkServiceRefused(ResponseCallback* callback, ServiceType service = ServiceType::Any) override;
void say(const MWWorld::Ptr& actor, const ESM::RefId& topic) override; bool say(const MWWorld::Ptr& actor, const ESM::RefId& topic) override;
// calbacks for the GUI // calbacks for the GUI
void keywordSelected(std::string_view keyword, ResponseCallback* callback) override; void keywordSelected(std::string_view keyword, ResponseCallback* callback) override;

View File

@ -534,7 +534,8 @@ namespace MWMechanics
if (greetingTimer >= GREETING_SHOULD_START) if (greetingTimer >= GREETING_SHOULD_START)
{ {
greetingState = Greet_InProgress; greetingState = Greet_InProgress;
MWBase::Environment::get().getDialogueManager()->say(actor, ESM::RefId::stringRefId("hello")); if (!MWBase::Environment::get().getDialogueManager()->say(actor, ESM::RefId::stringRefId("hello")))
greetingState = Greet_Done;
greetingTimer = 0; greetingTimer = 0;
} }
} }