From 3888cadf740d93e9ab1b78f104f5fe6a7ded94b1 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 3 Nov 2021 21:26:35 +0100 Subject: [PATCH] Clang happy? --- src/creature.cpp | 17 ++++++++++++++++- src/creature.h | 5 ++++- src/monster.cpp | 2 +- src/monster.h | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/creature.cpp b/src/creature.cpp index 67ed7c6614c4f..51f67c0e016fb 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -1196,7 +1196,11 @@ void Creature::deal_damage_handle_type( const effect_source &source, const damag case damage_type::STAB: case damage_type::BULLET: // these are bleed inducing damage types - make_bleed( source, bp, 1_minutes * rng( 1, adjusted_damage ) ); + if( !is_monster() ) { + make_bleed( source, bp, 1_minutes * rng( 1, adjusted_damage ) ); + } else { + make_bleed( source, 1_minutes * rng( 1, adjusted_damage ) ); + } default: break; @@ -1208,6 +1212,17 @@ void Creature::deal_damage_handle_type( const effect_source &source, const damag pain += roll_remainder( adjusted_damage / div ); } +void Creature::make_bleed( const effect_source &source, const bodypart_id &bp, + time_duration duration, + int intensity, bool permanent, bool force, bool defferred ) +{ +} + +void Creature::make_bleed( const effect_source &source, time_duration duration, int intensity, + bool permanent, bool force, bool defferred ) +{ +} + void Creature::heal_bp( bodypart_id /* bp */, int /* dam */ ) { } diff --git a/src/creature.h b/src/creature.h index 6f318747f39da..cbb44c1358327 100644 --- a/src/creature.h +++ b/src/creature.h @@ -469,7 +469,10 @@ class Creature : public viewer // Pass handling bleed to creature/character virtual void make_bleed( const effect_source &source, const bodypart_id &bp, time_duration duration, - int intensity = 1, bool permanent = false, bool force = false, bool defferred = false ) = 0; + int intensity = 1, bool permanent = false, bool force = false, bool defferred = false ); + + virtual void make_bleed( const effect_source &source, time_duration duration, + int intensity = 1, bool permanent = false, bool force = false, bool defferred = false ); // directly decrements the damage. ONLY handles damage, doesn't // increase pain, apply effects, etc diff --git a/src/monster.cpp b/src/monster.cpp index f383bf4f8b696..2e64c1f84073b 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1513,7 +1513,7 @@ bool monster::is_immune_damage( const damage_type dt ) const } } -void monster::make_bleed( const effect_source &source, const bodypart_id &bp, +void monster::make_bleed( const effect_source &source, time_duration duration, int intensity, bool permanent, bool force, bool defferred ) { if( type->bleed_rate == 0 ) { diff --git a/src/monster.h b/src/monster.h index 5631c01aa8655..f582c43c7c9b3 100644 --- a/src/monster.h +++ b/src/monster.h @@ -326,7 +326,7 @@ class monster : public Creature bool is_immune_effect( const efftype_id & ) const override; bool is_immune_damage( damage_type ) const override; - void make_bleed( const effect_source &source, const bodypart_id &bp, time_duration duration, + void make_bleed( const effect_source &source, time_duration duration, int intensity = 1, bool permanent = false, bool force = false, bool defferred = false ) override; const weakpoint *absorb_hit( const weakpoint_attack &attack, const bodypart_id &bp,