mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Don't change gas used in segments if there is still a cylinder with that gas
Otherwise adding a second cylinder (to the default one cylinder of air) and subsequently changing the gas of that cylinder will illogically change the gas used in all the segments. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d7fb6853a3
commit
1a3ea5636a
1 changed files with 5 additions and 0 deletions
|
@ -1303,6 +1303,11 @@ void DivePlannerPointsModel::tanksUpdated()
|
|||
// either nothing relevant changed, or exactly ONE gasmix changed
|
||||
for (int i = 0; i < gases.length(); i++) {
|
||||
if (gases.at(i) != oldGases.at(i)) {
|
||||
if (oldGases.count(oldGases.at(i)) > 1) {
|
||||
// we had this gas more than once, so don't
|
||||
// change segments that used this gas as it still exists
|
||||
break;
|
||||
}
|
||||
for (int j = 0; j < rowCount(); j++) {
|
||||
divedatapoint& p = divepoints[j];
|
||||
int o2 = oldGases.at(i).first;
|
||||
|
|
Loading…
Add table
Reference in a new issue