Skip to content

Commit 619f522

Browse files
author
尧杰 曾
committed
Fix bug: item given
tested
1 parent f22ff7f commit 619f522

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CDK/DatabaseManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public RedeemCDKResult RedeemCDK(UnturnedPlayer player, string CDK)
7070
else if (cdkdata.Items != string.Empty && cdkdata.Amount != string.Empty)
7171
{
7272
var items = cdkdata.Items.Split(',');
73-
var amount = cdkdata.Items.Split(',');
73+
var amount = cdkdata.Amount.Split(',');
7474
if(items.Length == amount.Length)
7575
{
7676
for(int i = 0;i<amount.Length;i++)
@@ -82,14 +82,16 @@ public RedeemCDKResult RedeemCDK(UnturnedPlayer player, string CDK)
8282
UnturnedChat.Say(player, Main.Instance.Translate("items_give_fail"), UnityEngine.Color.red);
8383
}
8484
}
85-
catch
85+
catch(Exception ex)
8686
{
87+
Logger.LogException(ex);
8788
UnturnedChat.Say(player, Main.Instance.Translate("cdk_config_error"), UnityEngine.Color.red);
8889
}
8990
}
9091
}
9192
else
9293
{
94+
Logger.LogError(String.Format("CDK: {0} item and amount length not equals",cdkdata.CDK));
9395
UnturnedChat.Say(player, Main.Instance.Translate("cdk_config_error"), UnityEngine.Color.red);
9496
}
9597
}

0 commit comments

Comments
 (0)