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

JSON-ify sleep 2: Skeep No More #76003

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,11 +1258,16 @@ static void sleep()
const map &here = get_map();
const tripoint_bub_ms &p = player_character.pos_bub();
const optional_vpart_position vp = here.veh_at( p );
const comfort_data::response &comfort = player_character.get_comfort_at( p.raw() );
if( here.has_flag( ter_furn_flag::TFLAG_DEEP_WATER, p ) && !vp &&
comfort.data->human_or_impossible() ) {
add_msg( m_info, _( "You cannot sleep while swimming." ) );
return;
const comfort_data::response &comfort = player_character.get_comfort_at( p );
if( !vp && comfort.data->human_or_impossible() ) {
if( here.has_flag( ter_furn_flag::TFLAG_DEEP_WATER, p ) ) {
add_msg( m_info, _( "You cannot sleep while swimming." ) );
return;
}
if( here.has_flag( ter_furn_flag::TFLAG_NO_FLOOR, p ) ) {
add_msg( m_info, _( "You cannot sleep while airborne." ) );
return;
}
}

uilist as_m;
Expand Down
Loading