From 03e77b493927d15105646aad30251ab2ab6f99c4 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 3 Nov 2024 00:37:07 -0700 Subject: fix: incorrect increment of extralevels map if PvpReward winodow has multiple extra rewards (need testing) --- Malmstone/Malmstone.csproj | 2 +- Malmstone/Plugin.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Malmstone/Malmstone.csproj b/Malmstone/Malmstone.csproj index 8a46364..bbf5c51 100644 --- a/Malmstone/Malmstone.csproj +++ b/Malmstone/Malmstone.csproj @@ -3,7 +3,7 @@ - 1.0.7.1 + 1.0.7.2 A PVP Series Malmstones Level Calculator https://github.com/goatcorp/Malmstone AGPL-3.0-or-later diff --git a/Malmstone/Plugin.cs b/Malmstone/Plugin.cs index bd1df32..f17807d 100644 --- a/Malmstone/Plugin.cs +++ b/Malmstone/Plugin.cs @@ -304,18 +304,19 @@ private void OnCommand(string command, string args) { if (PvPService.GetPvPSeriesInfo() != null) { - // TODO NEED TESTING!!! // If player claimed Extra Level reward (above Level 30) and we detect a decrease in Series level PvPSeriesInfo? PvPSeriesInfo = PvPService.GetPvPSeriesInfo(); if (PvPSeriesInfo == null) return; - if(PvPSeriesInfo.CurrentSeriesRank < CachedSeriesLevel && CachedSeriesLevel > 30) + if(PvPSeriesInfo.CurrentSeriesRank < CachedSeriesLevel && CachedSeriesLevel > 30) { - var extraLevels = CachedSeriesLevel - 30; - Logger.Debug("Player claimed extra levels: " + extraLevels+ ", new ExtraLevels is " + GetSavedExtraLevels() + extraLevels); - IncrementExtraLevels(extraLevels); + Logger.Debug("Player claimed extra levels: Old Level is " + GetSavedExtraLevels()); + if (IncrementExtraLevels(1)) + Logger.Debug("Successfully incremented extra levels for player"); + else + Logger.Debug("Failed to increment extra levels for player"); Configuration.Save(); - + CachedSeriesLevel = PvPSeriesInfo.CurrentSeriesRank; } else { -- cgit v1.2.3