summaryrefslogtreecommitdiff
path: root/hotfix-06_fix-two-cases-of-NPCs-printing-messages-in-odd-conte.patch
blob: 3ef0e2457304178030c186f5c3f774401ab62e80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From dea4a4901e2420aab13a60c40f7ed18e52be9197 Mon Sep 17 00:00:00 2001
From: Chaosvolt <chaosvolt@users.noreply.github.com>
Date: Thu, 11 Jan 2024 19:41:48 -0600
Subject: [PATCH] fix: two cases of NPCs printing messages in odd contexts
 (#4098)

fix: fix two cases of NPCs printing messages in odd contexts
---
 src/npcmove.cpp | 5 ++++-
 src/sounds.cpp  | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/npcmove.cpp b/src/npcmove.cpp
index b7ee6f6df0e..d55ff473d70 100644
--- a/src/npcmove.cpp
+++ b/src/npcmove.cpp
@@ -2365,7 +2365,10 @@ void npc::move_to( const tripoint &pt, bool no_bashing, std::set<tripoint> *nomo
             // other npcs should not try to move into this npc anymore,
             // so infinite loop can be avoided.
             realnomove->insert( pos() );
-            say( "<let_me_pass>" );
+            // Don't spam player with messages over followers blunder into each other.
+            if( !np->is_following() ) {
+                say( "<let_me_pass>" );
+            }
             np->move_away_from( pos(), true, realnomove );
             // if we moved NPC, readjust their path, so NPCs don't jostle each other out of their activity paths.
             if( np->attitude == NPCATT_ACTIVITY ) {
diff --git a/src/sounds.cpp b/src/sounds.cpp
index bed0803fd61..d59207f6cb3 100644
--- a/src/sounds.cpp
+++ b/src/sounds.cpp
@@ -497,7 +497,7 @@ void sounds::process_sound_markers( player *p )
                 !p->has_effect( effect_narcosis ) ) {
                 //Not kidding about sleep-through-firefight
                 p->wake_up();
-                add_msg( m_warning, _( "Something is making noise." ) );
+                p->add_msg_if_player( m_warning, _( "Something is making noise." ) );
             } else {
                 continue;
             }
-- 
2.43.0