mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix DIV0 SEGV
.. in WPrime, and also don't bother trying to autosolve CP when W'bal is negative if W' is not setup
This commit is contained in:
@@ -280,6 +280,9 @@ WPrime::PCP()
|
||||
{
|
||||
if (PCP_) return PCP_;
|
||||
|
||||
// check WPRIME is correct otherwise we will run forever!
|
||||
if (WPRIME < 10000) return PCP_ = CP; // Wprime not set properly
|
||||
|
||||
int cp = CP;
|
||||
do {
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class WPrime {
|
||||
double maxMatch();
|
||||
double minY, maxY;
|
||||
double TAU, PCP_, CP, WPRIME, EXP;
|
||||
double maxE() { return ((WPRIME - minY) / WPRIME) * 100.00f; }
|
||||
double maxE() { return WPRIME ? (((WPRIME - minY) / WPRIME) * 100.00f) : 0; }
|
||||
|
||||
double PCP();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user