This commit is contained in:
2026-01-11 10:35:12 +00:00
parent 373ddd863d
commit 511aade81c
9 changed files with 127 additions and 25 deletions
+2 -2
View File
@@ -541,11 +541,11 @@ export const notCapital = (checkCurrentCity = false): Constraint => ({
}
}
// Need nation to know capital
reqs.push({ kind: 'nation', id: ctx.nationId });
reqs.push({ kind: 'nation', id: ctx.nationId ?? 0 });
return reqs;
},
test: (ctx, view) => {
const nationReq: RequirementKey = { kind: 'nation', id: ctx.nationId };
const nationReq: RequirementKey = { kind: 'nation', id: ctx.nationId ?? 0 };
if (!view.has(nationReq)) return unknownOrDeny(ctx, [nationReq], '국가 정보가 없습니다.');
const nation = view.get(nationReq) as Nation | null;
if (!nation) return unknownOrDeny(ctx, [nationReq], '국가 정보가 없습니다.');
+7 -7
View File
@@ -181,11 +181,11 @@ export const existsDestGeneral = (): Constraint => ({
requires: (ctx) =>
resolveDestGeneralId(ctx) !== undefined
? [
{
kind: 'destGeneral',
id: resolveDestGeneralId(ctx) ?? 0,
},
]
{
kind: 'destGeneral',
id: resolveDestGeneralId(ctx) ?? 0,
},
]
: [],
test: (ctx, view) => {
const destGeneralId = resolveDestGeneralId(ctx);
@@ -292,8 +292,8 @@ export const mustBeNPC = (): Constraint => ({
if (!general) {
return unknownOrDeny(ctx, [req], '장수 정보가 없습니다.');
}
// Assuming npcState >= 2 means NPC. Need to verify exact logic if possible,
// but typically 0=human, 1=?, 2=NPC.
// Assuming npcState >= 2 means NPC. Need to verify exact logic if possible,
// but typically 0=human, 1=?, 2=NPC.
// Legacy: $general->getNPC() where 0:User, 1:Virtual User(unused?), 2:NPC ...
if (general.npcState >= 2) {
return allow();