int res = MGMT_CONTINUE;
double cw = curweight();
if (cw >= stop_weight) res = MGMT_NORMAL_STOP; else
- if (time(NULL) >= stop_time && MAX(cw, start_weight) - MIN(cw, start_weight) < MGMT_WEIGHT_GAIN) res = MGMT_ABORT;
+ if (time(NULL) >= stop_time && MAX(cw, start_weight) - MIN(cw, start_weight) < MGMT_WEIGHT_GAIN) res = MGMT_ABORT; else
+ if ((start_weight > cw) && (start_weight - cw >= MGMT_WEIGHT_LOSS)) res = MGMT_ABORT;
return res;
}