Disallow accepting already completed contracts

This commit is contained in:
Yury
2025-03-31 01:32:15 +03:00
parent 2fb730cb8c
commit b3c5fa3e2b
2 changed files with 14 additions and 2 deletions
@@ -1,4 +1,4 @@
using System.Text.Json;
using System.Text.Json;
using System.Text.Json.Serialization;
using Prospect.Server.Api.Models.Data;
using Prospect.Server.Api.Services.Auth.Extensions;
@@ -243,6 +243,9 @@ public class ClaimActiveContract : ICloudScriptFunction<FYClaimCompletedActiveCo
// TODO: Check for next unlock in contracts instead of relying on client
var newContracts = new List<FYActiveContractPlayerData>();
foreach (var contractIdToUnlock in request.ContractsToUnlock) {
if (contractsCompleted.ContractsIDs.Contains(contractIdToUnlock)) {
continue;
}
var contractToUnlock = contracts[contractIdToUnlock];
var progress = new int[contractToUnlock.Objectives.Length];
// TODO: Automatically set max progress of kill and visit objectives. To remove once kill and visit objectives are reported by the client.