From 65c225e93b88f6c1c02e01eb42a85d5d03ed5965 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Fri, 2 Jun 2023 22:40:52 +0800 Subject: [PATCH] Fix incorrect miss flag on judge pass. --- Assets/Cryville/Crtr/Judge.cs | 10 +++++----- Assets/Cryville/Crtr/JudgeAction.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Cryville/Crtr/Judge.cs b/Assets/Cryville/Crtr/Judge.cs index 644a054..75e66a7 100644 --- a/Assets/Cryville/Crtr/Judge.cs +++ b/Assets/Cryville/Crtr/Judge.cs @@ -35,7 +35,7 @@ namespace Cryville.Crtr { } internal interface IJudge { void Call(JudgeEvent ev, float time, Identifier id, bool onMiss, int index); - bool Pass(JudgeEvent ev, float time, Identifier[] ids, int depth); + bool Pass(JudgeEvent ev, float time, Identifier[] ids, bool onMiss, int depth); void UpdateScore(ScoreOperation op, PdtExpression exp); } public class Judge : IJudge { @@ -294,7 +294,7 @@ namespace Cryville.Crtr { } } void Execute(JudgeEvent ev, float time, PairList actions, bool onMiss, int depth = 0, int index = 0) { - if (ev.JudgeResult.Time != null) { + if (!onMiss && ev.JudgeResult.Time != null) { _jnumbuf = ev.JudgeResult.Time.Value; _jnumsrc.Invalidate(); _etor.ContextCascadeUpdate(_var_jt, _jnumsrc); _jvecbuf = ev.JudgeResult.Vector; _jvecsrc.Invalidate(); _etor.ContextCascadeUpdate(_var_jv, _jvecsrc); } @@ -315,7 +315,7 @@ namespace Cryville.Crtr { Execute(call.ReturnEvent, time, call.ReturnEvent.Definition.on_hit, false, depth + 1, call.ReturnIndex); } } - } + } void IJudge.Call(JudgeEvent ev, float time, Identifier id, bool onMiss, int index) { InsertEvent(ev.BaseEvent, new Clip((float)ev.StartTime, (float)ev.EndTime), id, ev.Handler, new JudgeCallContext { CalledOnMiss = onMiss, @@ -324,7 +324,7 @@ namespace Cryville.Crtr { ReturnIndex = index + 1, }); // TODO optimize GC } - bool IJudge.Pass(JudgeEvent ev, float time, Identifier[] ids, int depth) { + bool IJudge.Pass(JudgeEvent ev, float time, Identifier[] ids, bool onMiss, int depth) { if (depth >= 16) throw new JudgePropagationException(); foreach (var i in ids) { var def = _rs.judges[i]; @@ -336,7 +336,7 @@ namespace Cryville.Crtr { } else hitFlag = true; if (hitFlag) { - Execute(ev, time, def.on_hit, false, depth + 1); + Execute(ev, time, def.on_hit, onMiss, depth + 1); ev.Handler.ReportJudge(ev, time, i); return true; } diff --git a/Assets/Cryville/Crtr/JudgeAction.cs b/Assets/Cryville/Crtr/JudgeAction.cs index 290d139..c0bbf79 100644 --- a/Assets/Cryville/Crtr/JudgeAction.cs +++ b/Assets/Cryville/Crtr/JudgeAction.cs @@ -44,7 +44,7 @@ namespace Cryville.Crtr { _targets = k.ToArray(); } internal override JudgeActionResult Execute(IJudge judge, JudgeEvent ev, float time, PdtExpression exp, bool onMiss, int depth, int index) { - return new JudgeActionResult { BreakExecution = judge.Pass(ev, time, _targets, depth) }; + return new JudgeActionResult { BreakExecution = judge.Pass(ev, time, _targets, onMiss, depth) }; } } public class Score : JudgeAction {