mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use add_gas_switch_event in instead of duplicate
There is a add_gas_switch_event, so don't duplicate the code. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f6b29d093f
commit
746e6da75a
1 changed files with 3 additions and 4 deletions
|
@ -267,11 +267,10 @@ struct dive *create_dive_from_plan(struct diveplan *diveplan, const char **error
|
||||||
if (o2 != oldo2 || he != oldhe) {
|
if (o2 != oldo2 || he != oldhe) {
|
||||||
int plano2 = (o2 + 5) / 10 * 10;
|
int plano2 = (o2 + 5) / 10 * 10;
|
||||||
int planhe = (he + 5) / 10 * 10;
|
int planhe = (he + 5) / 10 * 10;
|
||||||
int value;
|
int idx;
|
||||||
if (add_gas(dive, plano2, planhe) < 0)
|
if (idx = add_gas(dive, plano2, planhe) < 0)
|
||||||
goto gas_error_exit;
|
goto gas_error_exit;
|
||||||
value = (plano2 / 10) | ((planhe / 10) << 16);
|
add_gas_switch_event(dive, dc, lasttime, idx);
|
||||||
add_event(dc, lasttime, 25, 0, value, "gaschange"); // SAMPLE_EVENT_GASCHANGE2
|
|
||||||
oldo2 = o2; oldhe = he;
|
oldo2 = o2; oldhe = he;
|
||||||
}
|
}
|
||||||
/* Create sample */
|
/* Create sample */
|
||||||
|
|
Loading…
Add table
Reference in a new issue