From d3488c3bc63e8f9ebf558f6e1cc2e688140c8e2c Mon Sep 17 00:00:00 2001 From: gamer147 Date: Mon, 8 Jun 2026 18:49:45 -0400 Subject: [PATCH] fix(viewer): default ClassExp.Level to 1 for new viewers Client RankMatchUI.onOpen indexes _classCharaExpList[level - 1] unconditionally; level 0 (the prior default) throws IOOR. Co-Authored-By: Claude Opus 4.7 --- SVSim.Database/Repositories/Viewer/ViewerRepository.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SVSim.Database/Repositories/Viewer/ViewerRepository.cs b/SVSim.Database/Repositories/Viewer/ViewerRepository.cs index 8d80812..30eb5e1 100644 --- a/SVSim.Database/Repositories/Viewer/ViewerRepository.cs +++ b/SVSim.Database/Repositories/Viewer/ViewerRepository.cs @@ -272,7 +272,9 @@ public class ViewerRepository : IViewerRepository { Class = ce, Exp = 0, - Level = 0, + // Client unconditionally indexes `_classCharaExpList[level - 1]` in + // RankMatchUI.onOpen → CharacterExps.GetClassCharacterExps; level 0 throws IOOR. + Level = 1, LeaderSkin = skin ?? new LeaderSkinEntry { Id = 0, Name = "", ClassId = ce.Id } }; }).ToList();