From c32188e0f59f92bb912154eb0f90ee3de0159110 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sat, 19 Jul 2025 08:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=BA=97=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Server/Controllers/DataRequestController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FunGame.Server/Controllers/DataRequestController.cs b/FunGame.Server/Controllers/DataRequestController.cs index 8bbc6f2..47828a5 100644 --- a/FunGame.Server/Controllers/DataRequestController.cs +++ b/FunGame.Server/Controllers/DataRequestController.cs @@ -1393,7 +1393,7 @@ namespace Milimoe.FunGame.Server.Controller { Goods goods = store.Goods[goodsId]; int count = counts[goodsId]; - if (count > goods.Stock) + if (goods.Stock != -1 && count > goods.Stock) { result = false; buyResult.Add($"购买失败,原因:库存不足,当前库存为:{goods.Stock},购买数量:{count}。"); @@ -1425,7 +1425,7 @@ namespace Milimoe.FunGame.Server.Controller } if (subResult) { - goods.Stock -= count; + if (goods.Stock != -1) goods.Stock -= count; totalCost += totalPrice; ProcessStoreBuy(goods, useCredits, price, count, user); buyResult.Add($"成功消费:{totalPrice} {currency},购买了 {count} 个 {goods.Name}。");