From 09ad0d3679ddca9f10aa51741e313a778e4b7c31 Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Mon, 1 Jul 2024 13:32:51 -0700 Subject: [PATCH] clean water stays clean in tanks --- src/map.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 5b0e780c769d4..9ffdd9109d7e4 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -5766,12 +5766,14 @@ void map::process_items_in_submap( submap ¤t_submap, const tripoint &gridp spoil_multiplier = 0.0f; } + bool furniture_is_sealed = has_flag( ter_furn_flag::TFLAG_SEALED, map_location ); + map_stack items = i_at( map_location ); process_map_items( *this, items, active_item_ref.item_ref, active_item_ref.parent, map_location, 1, flag, spoil_multiplier * active_item_ref.spoil_multiplier(), - active_item_ref.has_watertight_container() ); + furniture_is_sealed || active_item_ref.has_watertight_container() ); } } @@ -5850,9 +5852,10 @@ void map::process_items_in_vehicle( vehicle &cur_veh, submap ¤t_submap ) flag = temperature_flag::HEATER; } } + bool in_tank = pt.info().has_flag( VPFLAG_FLUIDTANK ); if( !process_map_items( *this, items, active_item_ref.item_ref, active_item_ref.parent, item_loc, it_insulation, flag, - active_item_ref.spoil_multiplier(), active_item_ref.has_watertight_container() ) ) { + active_item_ref.spoil_multiplier(), in_tank || active_item_ref.has_watertight_container() ) ) { // If the item was NOT destroyed, we can skip the remainder, // which handles fallout from the vehicle being damaged. continue;