From b1a1553ef4a56bf4b31998c29ae44b51a820633f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 8 Jun 2017 21:32:41 +0800 Subject: [PATCH] Fixed the error when sorting the result IVs. --- PokemonGoIV/2Report.vb | 5 ++++- oxt/PokemonGoIV/2Report.xba | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PokemonGoIV/2Report.vb b/PokemonGoIV/2Report.vb index 06360f8..999518d 100644 --- a/PokemonGoIV/2Report.vb +++ b/PokemonGoIV/2Report.vb @@ -254,7 +254,7 @@ Sub subSortIVs ( _ Dim nCP As Integer ' Calculate the sorting keys. - For nI = 0 To UBound (maIVs) - 1 + For nI = 0 To UBound (maIVs) maIVs (nI).nTotal = maIVs (nI).nAttack + maIVs (nI).nDefense _ + maIVs (nI).nStamina maIVs (nI).nMaxCP = fnCalcCP (aBaseStats, _ @@ -330,6 +330,7 @@ Function subSwapIV (aIVa As aIV, aIVb As aIV) As Double Dim aTempIV As New aIV With aTempIV + .fLevel = aIVa.fLevel .nAttack = aIVa.nAttack .nDefense = aIVa.nDefense .nStamina = aIVa.nStamina @@ -338,6 +339,7 @@ Function subSwapIV (aIVa As aIV, aIVb As aIV) As Double .nMaxMaxCP = aIVa.nMaxMaxCP End With With aIVa + .fLevel = aIVb.fLevel .nAttack = aIVb.nAttack .nDefense = aIVb.nDefense .nStamina = aIVb.nStamina @@ -346,6 +348,7 @@ Function subSwapIV (aIVa As aIV, aIVb As aIV) As Double .nMaxMaxCP = aIVb.nMaxMaxCP End With With aIVb + .fLevel = aTempIV.fLevel .nAttack = aTempIV.nAttack .nDefense = aTempIV.nDefense .nStamina = aTempIV.nStamina diff --git a/oxt/PokemonGoIV/2Report.xba b/oxt/PokemonGoIV/2Report.xba index c858242..5f8449d 100644 --- a/oxt/PokemonGoIV/2Report.xba +++ b/oxt/PokemonGoIV/2Report.xba @@ -256,7 +256,7 @@ Sub subSortIVs ( _ Dim nCP As Integer ' Calculate the sorting keys. - For nI = 0 To UBound (maIVs) - 1 + For nI = 0 To UBound (maIVs) maIVs (nI).nTotal = maIVs (nI).nAttack + maIVs (nI).nDefense _ + maIVs (nI).nStamina maIVs (nI).nMaxCP = fnCalcCP (aBaseStats, _ @@ -332,6 +332,7 @@ Function subSwapIV (aIVa As aIV, aIVb As aIV) As Double Dim aTempIV As New aIV With aTempIV + .fLevel = aIVa.fLevel .nAttack = aIVa.nAttack .nDefense = aIVa.nDefense .nStamina = aIVa.nStamina @@ -340,6 +341,7 @@ Function subSwapIV (aIVa As aIV, aIVb As aIV) As Double .nMaxMaxCP = aIVa.nMaxMaxCP End With With aIVa + .fLevel = aIVb.fLevel .nAttack = aIVb.nAttack .nDefense = aIVb.nDefense .nStamina = aIVb.nStamina @@ -348,6 +350,7 @@ Function subSwapIV (aIVa As aIV, aIVb As aIV) As Double .nMaxMaxCP = aIVb.nMaxMaxCP End With With aIVb + .fLevel = aTempIV.fLevel .nAttack = aTempIV.nAttack .nDefense = aTempIV.nDefense .nStamina = aTempIV.nStamina