Skip to content

Commit

Permalink
Forbid starting fires on water tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Night-Pryanik committed Oct 22, 2024
1 parent b246d05 commit 69b1494
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,12 @@ void activity_handlers::start_fire_do_turn( player_activity *act, Character *you
if( !here.is_flammable( where ) ) {
try_fuel_fire( *act, *you, true );
if( !here.is_flammable( where ) ) {
you->add_msg_if_player( m_info, _( "There's nothing to light there." ) );
if( here.has_flag_ter( ter_furn_flag::TFLAG_DEEP_WATER, where ) ||
here.has_flag_ter( ter_furn_flag::TFLAG_SHALLOW_WATER, where ) ) {
you->add_msg_if_player( m_info, _( "You can't light a fire on water." ) );
} else {
you->add_msg_if_player( m_info, _( "There's nothing to light there." ) );
}
you->cancel_activity();
return;
}
Expand Down
6 changes: 6 additions & 0 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3681,6 +3681,12 @@ bool map::is_flammable( const tripoint &p )

bool map::is_flammable( const tripoint_bub_ms &p )
{
// No fires on water tiles regardless of other factors
if( has_flag_ter( ter_furn_flag::TFLAG_DEEP_WATER, p ) ||
has_flag_ter( ter_furn_flag::TFLAG_SHALLOW_WATER, p ) ) {
return false;
}

if( has_flag( ter_furn_flag::TFLAG_FLAMMABLE, p ) ) {
return true;
}
Expand Down

0 comments on commit 69b1494

Please sign in to comment.