From 9712946688f008e7f7792a1a6281e2c26d5ef63c Mon Sep 17 00:00:00 2001 From: samnyan <205-neumphis@users.noreply.dev.s-ul.eu> Date: Sat, 1 Feb 2020 16:15:13 +0800 Subject: [PATCH] [DIVA] Ignore personal high score update when using rgo option or no fail mode --- .../diva/handler/ingame/StageResultHandler.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/icu/samnyan/aqua/sega/diva/handler/ingame/StageResultHandler.java b/src/main/java/icu/samnyan/aqua/sega/diva/handler/ingame/StageResultHandler.java index 625d3935..a10d8e40 100644 --- a/src/main/java/icu/samnyan/aqua/sega/diva/handler/ingame/StageResultHandler.java +++ b/src/main/java/icu/samnyan/aqua/sega/diva/handler/ingame/StageResultHandler.java @@ -69,12 +69,18 @@ public class StageResultHandler extends BaseHandler { PlayerPvRecord record = pvRecordRepository.findByPdIdAndPvIdAndEditionAndDifficulty(profile, log.getPvId(), log.getEdition(), log.getDifficulty()) .orElseGet(() -> new PlayerPvRecord(profile, log.getPvId(), log.getEdition(), log.getDifficulty())); - // Update pvRecord field - record.setMaxScore(Math.max(record.getMaxScore(), log.getScore())); - record.setMaxAttain(Math.max(record.getMaxAttain(), log.getAttainPoint())); + // Not save personal record in no fail mode + if(request.getGame_type() != 1) { + // Only update personal record when using rhythm game option + if (log.getRhythmGameOptions().equals("0,0,0")) { + // Update pvRecord field + record.setMaxScore(Math.max(record.getMaxScore(), log.getScore())); + record.setMaxAttain(Math.max(record.getMaxAttain(), log.getAttainPoint())); - if (record.getResult().getValue() < log.getClearResult().getValue()) { - record.setResult(log.getClearResult()); + if (record.getResult().getValue() < log.getClearResult().getValue()) { + record.setResult(log.getClearResult()); + } + } } String[] updateRgo = log.getRhythmGameOptions().split(",");