mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix adding gas change to a dive
Yikes this was stupid. We mixed changing the displayed_dive and the current_dive. So we'd pass in the displayed_dive and a pointer to the dive_computer structure of the current dc in the current dive. Oops. This makes much more sense. And: Fixes #738 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4a42fdaa71
commit
4fa3f89378
1 changed files with 3 additions and 1 deletions
|
@ -1243,7 +1243,9 @@ void ProfileWidget2::changeGas()
|
|||
qDebug() << "failed to parse tank number";
|
||||
tank = get_gasidx(&displayed_dive, &gasmix);
|
||||
}
|
||||
add_gas_switch_event(&displayed_dive, current_dc, seconds, tank);
|
||||
// add this both to the displayed dive and the current dive
|
||||
add_gas_switch_event(current_dive, current_dc, seconds, tank);
|
||||
add_gas_switch_event(&displayed_dive, get_dive_dc(&displayed_dive, dc_number), seconds, tank);
|
||||
// this means we potentially have a new tank that is being used and needs to be shown
|
||||
fixup_dive(&displayed_dive);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue