From 0f58a01772b2b9df630eb5133b62750c87b5125c Mon Sep 17 00:00:00 2001 From: Xynth22 <31621879+Xynth22@users.noreply.github.com> Date: Sat, 28 Oct 2017 22:03:37 -0500 Subject: [PATCH] Working around error with constants in IGC --- src/Igc/common.cpp | 30 +++++++++++++++--------------- src/Igc/igc.h | 8 ++++---- src/Igc/missionigc.cpp | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Igc/common.cpp b/src/Igc/common.cpp index 10142733..1830d83a 100644 --- a/src/Igc/common.cpp +++ b/src/Igc/common.cpp @@ -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; diff --git a/src/Igc/igc.h b/src/Igc/igc.h index 1f1fe018..1f69c513 100644 --- a/src/Igc/igc.h +++ b/src/Igc/igc.h @@ -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; // @@ -5597,7 +5597,7 @@ class PlayerScoreObject } void SetRepair(int repair) { - m_cRepair = repair; + m_cRepair += repair; } diff --git a/src/Igc/missionigc.cpp b/src/Igc/missionigc.cpp index 6b1e6c59..4ec7c3cb 100644 --- a/src/Igc/missionigc.cpp +++ b/src/Igc/missionigc.cpp @@ -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;