Changeset 2156

Show
Ignore:
Timestamp:
10/31/05 05:45:22 (3 years ago)
Author:
madcat
Message:

Fixed client creditscore calculation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hydranode/hncore/ed2k/creditsdb.h

    r2049 r2156  
    4343                } 
    4444                float score1 = m_uploaded ? m_downloaded * 2 / m_uploaded : 10; 
    45                 float score2 = sqrt(m_downloaded / 1024.0 * 1024.0) + 2; 
    46                 return score1 > score2 ? score1 : score2; 
     45                float score2 = sqrt(m_downloaded / (1024.0 * 1024.0) + 2.0); 
     46                if (score1 > score2) { 
     47                        score1 = score2; 
     48                } 
     49                if (score1 < 1.0) { 
     50                        return 1.0; 
     51                } else if (score1 > 10.0) { 
     52                        return 10.0; 
     53                } else { 
     54                        return score1; 
     55                } 
    4756        } 
    4857