mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 12:03:57 +00:00
Fix SupporterCard_Upgrade
This commit is contained in:
@@ -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++;
|
||||||
|
|||||||
Reference in New Issue
Block a user