修复签到错误问题

This commit is contained in:
milimoe 2025-01-01 03:49:36 +08:00
parent 0f48d2ea73
commit 815a780a70
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
2 changed files with 7 additions and 3 deletions

View File

@ -3518,7 +3518,11 @@ namespace Oshima.Core.Controllers
if (pc.Count > 0)
{
User user = FunGameService.GetUser(pc);
bool sign = pc.Get<bool>("signed");
bool sign = false;
if (pc.TryGetValue("signed", out object? value) && value is bool temp && temp)
{
sign = true;
}
if (sign)
{

View File

@ -680,8 +680,8 @@ namespace Oshima.Core.Utils
{
string msg = "签到成功!本次签到获得:";
int currency = Random.Shared.Next(1000, 3000);
msg += $"{currency} 金币和";
int material = Random.Shared.Next(1000, 3000);
msg += $"{currency} 金币和 ";
int material = Random.Shared.Next(5, 15);
msg += $"{material} 材料!额外获得:";
user.Inventory.Credits += currency;
user.Inventory.Materials += material;