From f3c247076baadae2937b73d7a523f49142f5a085 Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 22 Dec 2025 01:52:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaServers/Service/FunGameService.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/OshimaServers/Service/FunGameService.cs b/OshimaServers/Service/FunGameService.cs index dc12443..c5b5339 100644 --- a/OshimaServers/Service/FunGameService.cs +++ b/OshimaServers/Service/FunGameService.cs @@ -1365,16 +1365,14 @@ namespace Oshima.FunGame.OshimaServers.Service { "神话魔法卡礼包", QualityType.Red }, { "不朽魔法卡礼包", QualityType.Gold } }; - foreach (string key in magicCards.Keys) + if (magicCards.Where(kv => kv.Key == name).Select(kv => kv.Value).FirstOrDefault() is QualityType type) { - if (name == key) + for (int i = 0; i < box.Gifts[name]; i++) { - for (int i = 0; i < box.Gifts[name]; i++) - { - Item newItem = new 魔法卡礼包(magicCards[key], box.Gifts[name]); - AddItemToUserInventory(user, newItem, false, true); - } + Item newItem = new 魔法卡礼包(type, box.Gifts[name]); + AddItemToUserInventory(user, newItem, false, true); } + break; } } }