Fix SupporterCard_Upgrade

This commit is contained in:
Kei-Luna
2026-05-15 15:11:53 +09:00
parent e5ecdc7f2a
commit 46d945f3ce

View File

@@ -19,7 +19,7 @@ public class SupporterCard_Upgrade : ICallGSHandler
return; return;
} }
var supportCard = player.InventoryManager.InventoryData.Items.GetValueOrDefault((uint)req.SupportCardUid); var supportCard = player.InventoryManager.GetSupportCardItem((uint)req.SupportCardUid);
if (supportCard == null) if (supportCard == null)
{ {
await CallGSRouter.SendScript(connection, "Logistics_Upgrade", "{}"); await CallGSRouter.SendScript(connection, "Logistics_Upgrade", "{}");
@@ -68,10 +68,11 @@ public class SupporterCard_Upgrade : ICallGSHandler
} }
// Apply exp and level up // Apply exp and level up
if (supportCard.Level == 0) supportCard.Level = 1;
supportCard.Exp += gainedExp; supportCard.Exp += gainedExp;
while (supportCard.Level < maxLevel) while (supportCard.Level < maxLevel)
{ {
var expNeeded = GetExpNeeded(supportCard.Level + 1); var expNeeded = GetExpNeeded(supportCard.Level);
if (expNeeded == 0 || supportCard.Exp < expNeeded) break; if (expNeeded == 0 || supportCard.Exp < expNeeded) break;
supportCard.Exp -= expNeeded; supportCard.Exp -= expNeeded;
supportCard.Level++; supportCard.Level++;