diff --git a/src/monster.cpp b/src/monster.cpp index 59b31b85d56ae..1a1be47013245 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1772,7 +1772,7 @@ int monster::heal( const int delta_hp, bool overheal ) if( hp > maxhp && !overheal ) { hp = maxhp; } - return maxhp - old_hp; + return hp - old_hp; } void monster::set_hp( const int hp ) @@ -3118,9 +3118,14 @@ void monster::on_load() const int heal_amount = roll_remainder( regen * to_turns( dt ) ); const int healed = heal( heal_amount ); int healed_speed = 0; - if( healed < heal_amount && get_speed_base() < type->speed ) { - int old_speed = get_speed_base(); - set_speed_base( std::min( get_speed_base() + heal_amount - healed, type->speed ) ); + if( get_speed_base() < type->speed ) { + const int old_speed = get_speed_base(); + if( hp >= type->hp ) { + set_speed_base( type->speed ); + } else { + const int speed_delta = std::max( healed * type->speed / type->hp, 1 ); + set_speed_base( std::min( old_speed + speed_delta, type->speed ) ); + } healed_speed = get_speed_base() - old_speed; }