返回提交历史
Modified
src/controllers/api/syndicateSacrificeController.ts
+3
-3
XFEstudio/SpaceNinjaServer
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>
54a73ad5
代码差异
1 个文件
+3
-3
@@ -20,8 +20,8 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
20
20
21
21
const oldLevel = syndicate.Title ?? 0;
22
22
const levelIncrease = data.SacrificeLevel - oldLevel;
23
if (levelIncrease < 1) {
24
throw new Error(`syndicate sacrifice needs an increase of at least 1`);
23
if (levelIncrease < 0) {
24
throw new Error(`syndicate sacrifice can not decrease level`);
25
25
}
26
26
if (levelIncrease > 1 && !data.AllowMultiple) {
27
27
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
37
37
38
38
// Process sacrifices and rewards for every level we're reaching
39
39
const manifest = ExportSyndicates[data.AffiliationTag];
40
for (let level = oldLevel + 1; level <= data.SacrificeLevel; ++level) {
40
for (let level = oldLevel + levelIncrease; level <= data.SacrificeLevel; ++level) {
41
41
let sacrifice: ISyndicateSacrifice | undefined;
42
42
if (level == 0) {
43
43
sacrifice = manifest.initiationSacrifice;