Compare commits
2
Commits
c986a98471
...
078d2f80be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
078d2f80be | ||
|
|
14ab3267f4 |
@@ -155,12 +155,14 @@ public class PurchaseWeaponShopItemFunction : ICloudScriptFunction<PurchaseWeapo
|
|||||||
var blueprintData = blueprints[request.BaseItemID];
|
var blueprintData = blueprints[request.BaseItemID];
|
||||||
|
|
||||||
// Contract unlock criteria: some items can only be purchased after completing a
|
// Contract unlock criteria: some items can only be purchased after completing a
|
||||||
// specific contract. Only gate when the item explicitly declares such a lock, so
|
// specific contract. The data uses the sentinel "None" (not an empty string) for
|
||||||
// items with no lock keep working as before.
|
// items with no lock — treat that (and null/empty) as "no lock", otherwise EVERY
|
||||||
if (!string.IsNullOrEmpty(blueprintData.UnlockData?.ContractLockPurchase))
|
// item gets gated and nothing can be bought.
|
||||||
|
var contractLockPurchase = blueprintData.UnlockData?.ContractLockPurchase;
|
||||||
|
if (!string.IsNullOrEmpty(contractLockPurchase) && contractLockPurchase != "None")
|
||||||
{
|
{
|
||||||
var completed = JsonSerializer.Deserialize<FYGetCompletedContractsResult>(userData["ContractsOneTimeCompleted"].Value);
|
var completed = JsonSerializer.Deserialize<FYGetCompletedContractsResult>(userData["ContractsOneTimeCompleted"].Value);
|
||||||
if (completed?.ContractsIDs == null || !completed.ContractsIDs.Contains(blueprintData.UnlockData.ContractLockPurchase))
|
if (completed?.ContractsIDs == null || !completed.ContractsIDs.Contains(contractLockPurchase))
|
||||||
{
|
{
|
||||||
return new PurchaseWeaponShopItemResponse
|
return new PurchaseWeaponShopItemResponse
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user