Skip to content

Commit

Permalink
Update character.cpp (#71973)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramza13 authored Feb 26, 2024
1 parent 69614d5 commit 4d936d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,8 @@ void Character::react_to_felt_pain( int intensity )
g->cancel_activity_or_ignore_query( distraction_type::pain, _( "Ouch, something hurts!" ) );
}
// Only a large pain burst will actually wake people while sleeping.
if( has_effect( effect_sleep ) && !has_effect( effect_narcosis ) ) {
if( has_effect( effect_sleep ) && get_effect( effect_sleep ).get_duration() > 0_turns &&
!has_effect( effect_narcosis ) ) {
int pain_thresh = rng( 3, 5 );

if( has_bionic( bio_sleep_shutdown ) ) {
Expand Down Expand Up @@ -7517,8 +7518,8 @@ void Character::wake_up()
// effects) with a duration of 0 turns.

if( has_effect( effect_sleep ) ) {
get_event_bus().send<event_type::character_wakes_up>( getID() );
get_effect( effect_sleep ).set_duration( 0_turns );
get_event_bus().send<event_type::character_wakes_up>( getID() );
}
remove_effect( effect_slept_through_alarm );
remove_effect( effect_lying_down );
Expand Down

0 comments on commit 4d936d1

Please sign in to comment.