fix(turn): preserve legacy alternative command execution
This commit is contained in:
@@ -849,7 +849,8 @@ export const createReservedTurnHandler = async (options: {
|
||||
fallbackDefinition: GeneralActionDefinition,
|
||||
command: ReservedTurnEntry,
|
||||
applyNextTurnAt: boolean,
|
||||
alternativeDepth = 0
|
||||
alternativeDepth = 0,
|
||||
sharedActionRng?: RandUtil
|
||||
): { nextTurnAt?: Date; actionKey: string; usedFallback: boolean; blockedReason?: string } => {
|
||||
const resolvedDefinition = resolveDefinition(command.action, definitionMap, fallbackDefinition);
|
||||
const rawArgs = extractArgsRecord(command.args);
|
||||
@@ -945,11 +946,12 @@ export const createReservedTurnHandler = async (options: {
|
||||
itemRegistry,
|
||||
uniqueConfig,
|
||||
});
|
||||
let actionRng = sharedActionRng ?? buildRng(actionKey);
|
||||
let baseContext: ActionContextBase = {
|
||||
general: currentGeneral,
|
||||
city: currentCity,
|
||||
nation: currentNation,
|
||||
rng: buildRng(actionKey),
|
||||
rng: actionRng,
|
||||
uniqueLottery,
|
||||
};
|
||||
let specificContext = buildActionContext(
|
||||
@@ -976,11 +978,12 @@ export const createReservedTurnHandler = async (options: {
|
||||
usedFallback = true;
|
||||
blockedReason = '예약된 명령을 실행하지 못했습니다.';
|
||||
logs.push(createActionLog('예약된 명령을 실행하지 못했습니다.'));
|
||||
actionRng = sharedActionRng ?? buildRng(actionKey);
|
||||
baseContext = {
|
||||
general: currentGeneral,
|
||||
city: currentCity,
|
||||
nation: currentNation,
|
||||
rng: buildRng(actionKey),
|
||||
rng: actionRng,
|
||||
};
|
||||
specificContext = baseContext;
|
||||
}
|
||||
@@ -1278,7 +1281,8 @@ export const createReservedTurnHandler = async (options: {
|
||||
args: extractArgsRecord(resolution.alternative.args),
|
||||
},
|
||||
applyNextTurnAt,
|
||||
alternativeDepth + 1
|
||||
alternativeDepth + 1,
|
||||
actionRng
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user