Skip to content

Commit 2b9c123

Browse files
Bugfix for #82869 (#82931)
* - bugfix for #82869. added replace_with_npc_name to relevant usages of add_msg_if_player_sees * Update src/npc.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/npc.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent b1ff83d commit 2b9c123

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/messages.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ void add_msg( const game_message_params &params, std::string msg )
10111011
Messages::add_msg( params, std::move( msg ) );
10121012
}
10131013

1014+
// msg argument will not expand name place holders
10141015
void add_msg_if_player_sees( const tripoint_bub_ms &target, std::string msg )
10151016
{
10161017
const map &here = get_map();

src/npc.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,8 @@ bool npc::wield( item &it )
15441544
return false;
15451545
}
15461546
if( get_wielded_item() ) {
1547-
add_msg_if_player_sees( *this, m_info, _( "<npcname> wields a %s." ),
1547+
// add_msg_if_player_sees does no internal npc name replacement
1548+
add_msg_if_player_sees( *this, m_info, replace_with_npc_name( _( "<npcname> wields a %s." ) ),
15481549
get_wielded_item()->tname() );
15491550
}
15501551

@@ -1559,7 +1560,8 @@ bool npc::wield( item_location loc, bool remove_old )
15591560
return false;
15601561
}
15611562
if( get_wielded_item() ) {
1562-
add_msg_if_player_sees( *this, m_info, _( "<npcname> wields a %s." ),
1563+
// add_msg_if_player_sees does no internal npc name replacement
1564+
add_msg_if_player_sees( *this, m_info, replace_with_npc_name( _( "<npcname> wields a %s." ) ),
15631565
get_wielded_item()->tname() );
15641566
}
15651567

0 commit comments

Comments
 (0)