mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't access gasmix.o2.fraction
Air is a special gas that does not contain oxygen according to gasmix.o2.fraction. If you want to use the fo2, you need to use get_o2() to treat this special case correctly. This fixes a bug when setting the MND of a gas containing 21% oxygen when o2 is considered not narcotic. Reported-by: Christoph Gruen <gruen.christoph@gmail.com> Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
5e9ee9febb
commit
41258647d2
8 changed files with 9280 additions and 9276 deletions
|
@ -1499,12 +1499,12 @@ struct gas_bin_t bin_gasmix(struct gasmix mix, int size)
|
|||
{
|
||||
if (gasmix_is_air(mix))
|
||||
return gas_bin_t::air();
|
||||
if (mix.o2.permille == 1000)
|
||||
if (get_o2(mix) == 1000)
|
||||
return gas_bin_t::oxygen();
|
||||
return mix.he.permille == 0 ?
|
||||
gas_bin_t::ean(mix.o2.permille / 10 / size * size) :
|
||||
gas_bin_t::trimix(mix.o2.permille / 10 / size * size,
|
||||
mix.he.permille / 10 / size * size);
|
||||
return get_he(mix) == 0 ?
|
||||
gas_bin_t::ean(get_o2(mix) / 10 / size * size) :
|
||||
gas_bin_t::trimix(get_o2(mix) / 10 / size * size,
|
||||
get_he(mix) / 10 / size * size);
|
||||
}
|
||||
|
||||
struct GasTypeBinner : public MultiBinner<GasTypeBinner, GasTypeBin> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue