Skip to content

Commit

Permalink
Merge pull request #78055 from Procyonae/DistractionsRespectInVehicle
Browse files Browse the repository at this point in the history
Dangerous field distractions factor in in_vehicle immunity
  • Loading branch information
Night-Pryanik authored Nov 21, 2024
2 parents ac40555 + 589506f commit c5b5049
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4379,6 +4379,15 @@ field_entry *game::is_in_dangerous_field()
map &here = get_map();
for( std::pair<const field_type_id, field_entry> &field : here.field_at( u.pos_bub() ) ) {
if( u.is_dangerous_field( field.second ) ) {
if( u.in_vehicle ) {
bool not_safe = false;
for( const field_effect &fe : field.second.field_effects() ) {
not_safe |= !fe.immune_inside_vehicle;
}
if( !not_safe ) {
continue;
}
}
return &field.second;
}
}
Expand Down

0 comments on commit c5b5049

Please sign in to comment.