Skip to content

Commit

Permalink
Working around error with constants in IGC
Browse files Browse the repository at this point in the history
  • Loading branch information
Xynth22 committed Oct 29, 2017
1 parent aa6854d commit 0f58a01
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions src/Igc/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2543,21 +2543,21 @@ void PlayerScoreObject::CalculateScore(ImissionIGC* pmission)
float kMax = m_dtPlayed / (15.0f * 60.0f); //1.0 / 15 minutes


m_fScore = float(m_cWarpsSpotted) * pmission->GetFloatConstant(c_fcidPointsWarp) +
float(m_cAsteroidsSpotted) * pmission->GetFloatConstant(c_fcidPointsAsteroid) +
m_cTechsRecovered * pmission->GetFloatConstant(c_fcidPointsTech) +
(m_cMinerKills * kMax) * pmission->GetFloatConstant(c_fcidPointsMiner) / (m_cMinerKills + kMax) +
(m_cBuilderKills * kMax) * pmission->GetFloatConstant(c_fcidPointsBuilder) / (m_cBuilderKills + kMax) +
(m_cLayerKills * kMax) * pmission->GetFloatConstant(c_fcidPointsLayer) / (m_cLayerKills + kMax) +
(m_cCarrierKills * kMax) * pmission->GetFloatConstant(c_fcidPointsCarrier) / (m_cCarrierKills + kMax) +
m_cPlayerKills * pmission->GetFloatConstant(c_fcidPointsPlayer) +
(m_cBaseKills * kMax) * pmission->GetFloatConstant(c_fcidPointsBaseKill) / (m_cBaseKills + kMax) +
(m_cBaseCaptures * kMax) * pmission->GetFloatConstant(c_fcidPointsBaseCapture) / (m_cBaseCaptures + kMax) +
float(m_cRescues) * pmission->GetFloatConstant(c_fcidPointsRescues) +
float(m_cArtifacts) * pmission->GetFloatConstant(c_fcidPointsArtifacts) +
float(m_cFlags) * pmission->GetFloatConstant(c_fcidPointsFlags) +
float(m_cProbeSpot) * pmission->GetFloatConstant(c_fcidPointsProbeSpot) +
float(m_cRepair) * pmission->GetFloatConstant(c_fcidPointsRepair);
m_fScore = float(m_cWarpsSpotted) * pmission->GetFloatConstant(c_fcidPointsWarp) +
float(m_cAsteroidsSpotted) * pmission->GetFloatConstant(c_fcidPointsAsteroid) +
m_cTechsRecovered * pmission->GetFloatConstant(c_fcidPointsTech) +
(m_cMinerKills * kMax) * pmission->GetFloatConstant(c_fcidPointsMiner) / (m_cMinerKills + kMax) +
(m_cBuilderKills * kMax) * pmission->GetFloatConstant(c_fcidPointsBuilder) / (m_cBuilderKills + kMax) +
(m_cLayerKills * kMax) * pmission->GetFloatConstant(c_fcidPointsLayer) / (m_cLayerKills + kMax) +
(m_cCarrierKills * kMax) * pmission->GetFloatConstant(c_fcidPointsCarrier) / (m_cCarrierKills + kMax) +
m_cPlayerKills * pmission->GetFloatConstant(c_fcidPointsPlayer) +
(m_cBaseKills * kMax) * pmission->GetFloatConstant(c_fcidPointsBaseKill) / (m_cBaseKills + kMax) +
(m_cBaseCaptures * kMax) * pmission->GetFloatConstant(c_fcidPointsBaseCapture) / (m_cBaseCaptures + kMax) +
float(m_cRescues) * pmission->GetFloatConstant(c_fcidPointsRescues) +
float(m_cArtifacts) * pmission->GetFloatConstant(c_fcidPointsArtifacts) +
float(m_cFlags) * pmission->GetFloatConstant(c_fcidPointsFlags) +
float(m_cProbeSpot) * 10 + //pmission->GetFloatConstant(c_fcidPointsProbeSpot) +
float(m_cRepair) * 0.0006; // pmission->GetFloatConstant(c_fcidPointsRepair);

if (m_bWin)
m_fScore *= 2.0f;
Expand Down
8 changes: 4 additions & 4 deletions src/Igc/igc.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ const FloatConstantID c_fcidPlayerCost = 36;
const FloatConstantID c_fcidBaseClusterCost = 37;
const FloatConstantID c_fcidClusterDivisor = 38;

const FloatConstantID c_fcidPointsProbeSpot = 40;
const FloatConstantID c_fcidPointsRepair = 41;
//const FloatConstantID c_fcidPointsProbeSpot = 39;
//const FloatConstantID c_fcidPointsRepair = 40;

const FloatConstantID c_fcidMax = 42;
const FloatConstantID c_fcidMax = 40;


//
Expand Down Expand Up @@ -5597,7 +5597,7 @@ class PlayerScoreObject
}
void SetRepair(int repair)
{
m_cRepair = repair;
m_cRepair += repair;
}


Expand Down
4 changes: 2 additions & 2 deletions src/Igc/missionigc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2763,8 +2763,8 @@ CstaticIGC::CstaticIGC(void)
m_constants.floatConstants[c_fcidPointsFlags] = c_pointsFlags;
m_constants.floatConstants[c_fcidPointsArtifacts] = c_pointsArtifacts;
m_constants.floatConstants[c_fcidPointsRescues] = c_pointsRescues;
m_constants.floatConstants[c_fcidPointsProbeSpot] = c_pointsProbeSpot;
m_constants.floatConstants[c_fcidPointsRepair] = c_pointsRepair;
//m_constants.floatConstants[c_fcidPointsProbeSpot] = c_pointsProbeSpot;
//m_constants.floatConstants[c_fcidPointsRepair] = c_pointsRepair;
m_constants.floatConstants[c_fcidRatingAdd] = c_crAdd;
m_constants.floatConstants[c_fcidRatingDivide] = c_crDivide;

Expand Down

0 comments on commit 0f58a01

Please sign in to comment.