fix: 장수 런타임 레벨 상한을 Ref 기준으로 복구

가입 능력치 배분 상한과 런타임 레벨 상한을 분리하고, Ref 기본값 255를 공유 상수로 통합한다. 모병 후 레벨 유지와 국가 장수 목록의 고레벨 표시를 회귀 테스트로 고정한다.
This commit is contained in:
Hide_D committed 2026-08-21 08:37:38 +00:00
1 parent bba0d3b5c0
commit deb01f7f2b
21 files changed
+124 -49

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
import { TRPCError } from '@trpc/server';
import { asNumber, asRecord } from '@sammo-ts/common';
import { LogCategory, LogScope } from '@sammo-ts/logic';
import { LEGACY_DEFAULT_MAX_LEVEL, LogCategory, LogScope } from '@sammo-ts/logic';
import { z } from 'zod';
import type { GameApiContext } from '../../context.js';
@@ -573,7 +573,7 @@ export const publicRouter = router({
const nationMap = new Map(nations.map((nation) => [nation.id, nation]));
const worldConfig = asRecord(worldState?.config);
const worldConstants = asRecord(worldConfig.const);
const maxLevel = Math.max(0, Math.floor(asNumber(worldConstants.maxLevel, 255)));
const maxLevel = Math.max(0, Math.floor(asNumber(worldConstants.maxLevel, LEGACY_DEFAULT_MAX_LEVEL)));
const maxDedLevel = Math.max(0, Math.floor(asNumber(worldConstants.maxDedLevel, 30)));
// Legacy a_npcList.php shows select_pool humans first and possessed npc=1 rows.