From 6df638449f7ea605a480937a5e018d9a21bcc12c Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Mon, 18 Feb 2019 06:57:28 -0500 Subject: [PATCH] Fix loved maps overwrite on both regular and relax; comment out log for completed statuses --- objects/rxscore.pyx | 31 +++++++++++++++++++++---------- objects/score.pyx | 31 +++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/objects/rxscore.pyx b/objects/rxscore.pyx index 36bee2f..2623bdf 100644 --- a/objects/rxscore.pyx +++ b/objects/rxscore.pyx @@ -232,17 +232,28 @@ class score: self.oldPersonalBest = 0 else: # Compare personal best's score with current score - if self.pp > personalBest["pp"]: - # New best score - self.completed = 3 - self.rankedScoreIncrease = self.score-personalBest["score"] - self.oldPersonalBest = personalBest["id"] - else: - self.completed = 2 - self.rankedScoreIncrease = 0 - self.oldPersonalBest = 0 + if b.rankedStatus == rankedStatus.RANKED: + if self.pp > personalBest["pp"]: + # New best score + self.completed = 3 + self.rankedScoreIncrease = self.score-personalBest["score"] + self.oldPersonalBest = personalBest["id"] + else: + self.completed = 2 + self.rankedScoreIncrease = 0 + self.oldPersonalBest = 0 + elif b.rankedStatus == rankedStatus.LOVED: + if self.score > personalBest["score"]: + # New best score + self.completed = 3 + self.rankedScoreIncrease = self.score-personalBest["score"] + self.oldPersonalBest = personalBest["id"] + else: + self.completed = 2 + self.rankedScoreIncrease = 0 + self.oldPersonalBest = 0 - log.info("Completed status: {}".format(self.completed)) + #log.info("Completed status: {}".format(self.completed)) def saveScoreInDB(self): """ diff --git a/objects/score.pyx b/objects/score.pyx index 53aa444..e8c0c76 100644 --- a/objects/score.pyx +++ b/objects/score.pyx @@ -231,17 +231,28 @@ class score: self.oldPersonalBest = 0 else: # Compare personal best's score with current score - if self.pp > personalBest["pp"]: - # New best score - self.completed = 3 - self.rankedScoreIncrease = self.score-personalBest["score"] - self.oldPersonalBest = personalBest["id"] - else: - self.completed = 2 - self.rankedScoreIncrease = 0 - self.oldPersonalBest = 0 + if b.rankedStatus == rankedStatus.RANKED: + if self.pp > personalBest["pp"]: + # New best score + self.completed = 3 + self.rankedScoreIncrease = self.score-personalBest["score"] + self.oldPersonalBest = personalBest["id"] + else: + self.completed = 2 + self.rankedScoreIncrease = 0 + self.oldPersonalBest = 0 + elif b.rankedStatus == rankedStatus.LOVED: + if self.score > personalBest["score"]: + # New best score + self.completed = 3 + self.rankedScoreIncrease = self.score-personalBest["score"] + self.oldPersonalBest = personalBest["id"] + else: + self.completed = 2 + self.rankedScoreIncrease = 0 + self.oldPersonalBest = 0 - log.info("Completed status: {}".format(self.completed)) + #log.info("Completed status: {}".format(self.completed)) def saveScoreInDB(self): """