From 54a73ad5d7eab867a1701ccf66d56446db96c226 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 12 Jun 2025 09:20:32 -0700 Subject: [PATCH] fix: syndicate initiation (#2149) Was accidentially broken by 1979b20f8cc00b79f305478f1da3d69f90a3d43e Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2149 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/syndicateSacrificeController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/api/syndicateSacrificeController.ts b/src/controllers/api/syndicateSacrificeController.ts index 021608b3..64b46bbd 100644 --- a/src/controllers/api/syndicateSacrificeController.ts +++ b/src/controllers/api/syndicateSacrificeController.ts @@ -20,8 +20,8 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp const oldLevel = syndicate.Title ?? 0; const levelIncrease = data.SacrificeLevel - oldLevel; - if (levelIncrease < 1) { - throw new Error(`syndicate sacrifice needs an increase of at least 1`); + if (levelIncrease < 0) { + throw new Error(`syndicate sacrifice can not decrease level`); } if (levelIncrease > 1 && !data.AllowMultiple) { throw new Error(`desired syndicate level is an increase of ${levelIncrease}, max. allowed increase is 1`); @@ -37,7 +37,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp // Process sacrifices and rewards for every level we're reaching const manifest = ExportSyndicates[data.AffiliationTag]; - for (let level = oldLevel + 1; level <= data.SacrificeLevel; ++level) { + for (let level = oldLevel + levelIncrease; level <= data.SacrificeLevel; ++level) { let sacrifice: ISyndicateSacrifice | undefined; if (level == 0) { sacrifice = manifest.initiationSacrifice;