Use double for calculation

This commit is contained in:
Benau 2018-06-09 18:53:44 +08:00
parent 7c14fd28ba
commit 9133275677
2 changed files with 6 additions and 6 deletions

View File

@ -995,7 +995,7 @@ void ServerLobby::computeNewRankings()
result = std::max(0.0, 0.5 - result);
}
float max_time = std::min(std::max(player1_time, player2_time),
double max_time = std::min(std::max(player1_time, player2_time),
MAX_SCALING_TIME);
ranking_importance = mode_factor *
scalingValueForTime(max_time) * player_factors;
@ -1075,7 +1075,7 @@ double ServerLobby::getModeSpread()
/** Compute the scaling value of a given time
* Short races are more random, so we don't use strict proportionality
*/
double ServerLobby::scalingValueForTime(float time)
double ServerLobby::scalingValueForTime(double time)
{
return time * sqrt(time / 120.0) * MAX_POINTS_PER_SECOND;
} // scalingValueForTime

View File

@ -197,7 +197,7 @@ private:
double distributeBasePoints(uint32_t online_id);
double getModeFactor();
double getModeSpread();
double scalingValueForTime(float time);
double scalingValueForTime(double time);
void checkRaceFinished();
public: