Skip to content

Commit

Permalink
Merge pull request CleverRaven#70244 from inogenous/bugfix-grabbed-bo…
Browse files Browse the repository at this point in the history
…dypart-msg

Bugfix: Show correct bodypart in grabs
  • Loading branch information
Maleclypse authored Dec 17, 2023
2 parents 0f8ac41 + 1bf0e4e commit 04b6eb2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mattack_actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ bool melee_actor::call( monster &z ) const

// We need to do some calculations in the main function - we might mutate bp_hit
// But first we need to handle exclusive grabs etc.
std::optional<bodypart_id> grabbed_bp_id;
if( is_grab ) {
int eff_grab_strength = grab_data.grab_strength == -1 ? z.get_grab_strength() :
grab_data.grab_strength;
Expand Down Expand Up @@ -831,6 +832,7 @@ bool melee_actor::call( monster &z ) const
} else if( result == 0 ) {
return true;
}
grabbed_bp_id = bp_id;
}

// Damage instance calculation
Expand Down Expand Up @@ -870,7 +872,7 @@ bool melee_actor::call( monster &z ) const
sfx::get_heard_angle( z.pos() ) );
target->add_msg_player_or_npc( msg_type, no_dmg_msg_u,
get_option<bool>( "LOG_MONSTER_ATTACK_MONSTER" ) ? no_dmg_msg_npc : to_translation( "" ),
mon_name, body_part_name_accusative( bp_id ) );
mon_name, body_part_name_accusative( grabbed_bp_id.value_or( bp_id ) ) );
if( !effects_require_dmg ) {
for( const mon_effect_data &eff : effects ) {
if( x_in_y( eff.chance, 100 ) ) {
Expand Down

0 comments on commit 04b6eb2

Please sign in to comment.