Skip to content

Commit

Permalink
sounds: squelch NPC messages regarding hearing footsteps (#28424)
Browse files Browse the repository at this point in the history
NPCs don't respond to ambient sounds which is good, but they
continue processing them past point where all processing is
supposed to be PC only.  Fix that.
  • Loading branch information
mlangsdorf authored and kevingranade committed Mar 1, 2019
1 parent 3fa54b3 commit 367442a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,12 @@ void sounds::process_sound_markers( player *p )
}

const std::string &description = sound.description.empty() ? "a noise" : sound.description;
if( p->is_npc() && !sound.ambient ) {
npc *guy = dynamic_cast<npc *>( p );
guy->handle_sound( static_cast<int>( sound.category ), description, heard_volume, pos );
if( p->is_npc() ) {
if( !sound.ambient ) {
npc *guy = dynamic_cast<npc *>( p );
guy->handle_sound( static_cast<int>( sound.category ), description,
heard_volume, pos );
}
continue;
}

Expand Down

0 comments on commit 367442a

Please sign in to comment.