anchor.diff:  		valve_open = !valve_open
   		timing = FALSE
   
  +	var/turf/location = get_turf(src)
  +
  +	var/mix_air = FALSE
  +	var/pressure = release_pressure
  +	var/gas_mix = holding?.air_contents
  +	var/air_update = FALSE
  +
  +	if(valve_open)
  +		mix_air = TRUE
  +
  +	// When at least 10% of integrity is lost it starts checking for leaking
  +	if(obj_integrity < max_integrity * 0.9)
  +		var/leak_chance = (1 - obj_integrity / max_integrity) * 100
  +		if(prob(leak_chance))
  +			mix_air = TRUE
  +			pressure = air_contents.return_pressure() / 10
  +			gas_mix = location.return_air()
  +			air_update = TRUE
  +
   	// Handle gas transfer.
  -	if(valve_open)
  -		var/turf/T = get_turf(src)
  -		var/datum/gas_mixture/target_air = holding ? holding.air_contents : T.return_air()
  -
  -		if(air_contents.release_gas_to(target_air, release_pressure) && !holding)
  +	if(mix_air)
  +		var/datum/gas_mixture/target_air = gas_mix || location.return_air()
  +
  +		if(air_contents.release_gas_to(target_air, pressure) && (!holding || air_update))
   			air_update_turf(FALSE, FALSE)
   
   	var/our_pressure = air_contents.return_pressure()
  
positive.code: 
  /obj/machinery/portable_atmospherics/canister/Initialize(mapload, datum/gas_mixture/existing_mixture)
  	. = ..()
  	if(existing_mixture)
  		air_contents.copy_from(existing_mixture)
  	else
  		create_gas()
  	update_appearance()
  
  /obj/machinery/portable_atmospherics/canister/ComponentInitialize()
  
negative.code: /obj/machinery/portable_atmospherics/canister/proc/canister_break()
  	disconnect()
  	var/datum/gas_mixture/expelled_gas = air_contents.remove(air_contents.total_moles())
  	var/expelled_pressure = expelled_gas?.return_pressure()
  	var/turf/T = get_turf(src)
  	T.assume_air(expelled_gas)
  	air_update_turf(FALSE, FALSE)
  	obj_break()
  
  	if(expelled_pressure > pressure_limit)
  		var/pressure_dif = expelled_pressure - pressure_limit
  		var/max_pressure_difference = 20000
  		var/explosion_range = CEILING(min(pressure_dif, max_pressure_difference) / 1000, 1)
  		explosion(T, 0, 0, explosion_range, 0, smoke = FALSE)
  
  	density = FALSE
  	playsound(src.loc, 'sound/effects/spray.ogg', 10, TRUE, -3)
  	investigate_log("was destroyed.", INVESTIGATE_ATMOS)
  