Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes "Bloodless monsters can still get bled by butchery, leave blood splatter on ranged hits" #62189

Merged
merged 5 commits into from Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/ballistics.cpp
Expand Up @@ -442,10 +442,13 @@ dealt_projectile_attack projectile_attack( const projectile &proj_arg, const tri
// Critter can still dodge the projectile
// In this case hit_critter won't be set
if( attack.hit_critter != nullptr ) {
const size_t bt_len = blood_trail_len( attack.dealt_dam.total_damage() );
if( bt_len > 0 ) {
const tripoint &dest = move_along_line( tp, trajectory, bt_len );
here.add_splatter_trail( critter->bloodType(), tp, dest );
const field_type_id blood_type = critter->bloodType();
if( blood_type ) {
alef marked this conversation as resolved.
Show resolved Hide resolved
const size_t bt_len = blood_trail_len( attack.dealt_dam.total_damage() );
if( bt_len > 0 ) {
const tripoint &dest = move_along_line( tp, trajectory, bt_len );
here.add_splatter_trail( blood_type, tp, dest );
}
}
sfx::do_projectile_hit( *attack.hit_critter );
has_momentum = false;
Expand Down
7 changes: 4 additions & 3 deletions src/game.cpp
Expand Up @@ -8747,9 +8747,10 @@ static void butcher_submenu( const std::vector<map_stack::iterator> &corpses, in
corpses[index]->has_flag( flag_FIELD_DRESS_FAILED ) ) ) {
has_organs = true;
}
if( entry.type == harvest_drop_blood && !( corpses[index]->has_flag( flag_QUARTERED ) ||
corpses[index]->has_flag( flag_FIELD_DRESS ) ||
corpses[index]->has_flag( flag_FIELD_DRESS_FAILED ) || corpses[index]->has_flag( flag_BLED ) ) ) {
if( entry.type == harvest_drop_blood && dead_mon->bleed_rate > 0 &&
!( corpses[index]->has_flag( flag_QUARTERED ) ||
corpses[index]->has_flag( flag_FIELD_DRESS ) ||
corpses[index]->has_flag( flag_FIELD_DRESS_FAILED ) || corpses[index]->has_flag( flag_BLED ) ) ) {
has_blood = true;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/mtype.cpp
Expand Up @@ -153,9 +153,11 @@ std::vector<std::string> mtype::species_descriptions() const

field_type_id mtype::get_bleed_type() const
{
for( const species_id &s : species ) {
if( !s->bleeds.is_empty() ) {
return s->bleeds;
if( bleed_rate > 0 ) {
for( const species_id &s : species ) {
if( !s->bleeds.is_empty() ) {
return s->bleeds;
}
}
}
return fd_null;
Expand Down