Force BikeScore to zero for runs and swims

Even when it is considered not relevant for runs and swims the metric
code computes the value if power data is present which may produce
unwanted results as reported at the users forum.
This commit is contained in:
Ale Martinez
2019-01-26 20:47:09 -03:00
parent e8fe5906c8
commit 4886a8dee1

View File

@@ -406,8 +406,9 @@ class BikeScore : public RideMetric {
void compute(RideItem *item, Specification, const QHash<QString,RideMetric*> &deps) {
// no zones
if (item->context->athlete->zones(item->isRun)==NULL || item->zoneRange < 0) {
// run, swim or no zones
if (item->isSwim || item->isRun ||
!item->context->athlete->zones(item->isRun) || item->zoneRange < 0) {
setValue(RideFile::NIL);
setCount(0);
return;