From d3cf91e01406d51da76b3dd3dcfd633931c352eb Mon Sep 17 00:00:00 2001 From: milimoe Date: Fri, 30 May 2025 19:12:20 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D=EF=BC=8C=E5=BC=80?= =?UTF-8?q?=E5=90=AF2.0-dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Server/Controllers/DataRequestController.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FunGame.Server/Controllers/DataRequestController.cs b/FunGame.Server/Controllers/DataRequestController.cs index 2563bad..0e7c097 100644 --- a/FunGame.Server/Controllers/DataRequestController.cs +++ b/FunGame.Server/Controllers/DataRequestController.cs @@ -1421,7 +1421,7 @@ namespace Milimoe.FunGame.Server.Controller else { subResult = false; - buyResult.Add($"购买失败,原因:需要花费 {totalPrice} {General.GameplayEquilibriumConstant.InGameMaterial},但是您只有 {user.Inventory.Credits} {General.GameplayEquilibriumConstant.InGameMaterial}。"); + buyResult.Add($"购买失败,原因:需要花费 {totalPrice} {General.GameplayEquilibriumConstant.InGameMaterial},但是您只有 {user.Inventory.Materials} {General.GameplayEquilibriumConstant.InGameMaterial}。"); } if (subResult) { @@ -1652,10 +1652,11 @@ namespace Milimoe.FunGame.Server.Controller { "targets", targets }, { "useCount", useCount } }; - bool used = item.UseItem(args); + bool used = item.UseItem(user, args); if (used) { SQLHelper.UpdateInventory(user.Inventory); + result = true; } } if (result) @@ -1698,6 +1699,7 @@ namespace Milimoe.FunGame.Server.Controller user.Inventory.Credits += reward; item.EntityState = EntityState.Deleted; SQLHelper.UpdateInventory(user.Inventory); + result = true; } } if (result) @@ -2017,14 +2019,13 @@ namespace Milimoe.FunGame.Server.Controller } } - if (msg != "") + if (msg == "") { offer = SQLHelper.GetOffer(offerId); if (offer != null) { SQLHelper.Commit(); resultData.Add("offer", offer); - msg = ""; } } }