移除 Copy 调用,防止无限递归

This commit is contained in:
milimoe 2025-06-02 20:56:48 +08:00
parent 22889598ec
commit 79cf4decb5
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
3 changed files with 3 additions and 24 deletions

View File

@ -33,7 +33,7 @@ namespace Oshima.FunGame.OshimaModules
{
return (id, name, args) =>
{
Character? character = id switch
return id switch
{
1 => new OshimaShiya(),
2 => new XinYin(),
@ -49,13 +49,6 @@ namespace Oshima.FunGame.OshimaModules
12 => new Quduoduo(),
_ => null,
};
if (character is null && KnownCharacters.Values.FirstOrDefault(i => i.Id == id) is Character known)
{
character = known.Copy();
}
return character;
};
}
}

View File

@ -33,7 +33,7 @@ namespace Oshima.FunGame.OshimaModules
{
return (id, name, args) =>
{
Item? item = id switch
return id switch
{
(long)AccessoryID.8 => new 8(),
(long)AccessoryID.20 => new 20(),
@ -64,13 +64,6 @@ namespace Oshima.FunGame.OshimaModules
(long)GiftBoxID. => new (),
_ => null,
};
if (item is null && KnownItems.Values.FirstOrDefault(i => i.Id == id) is Item known)
{
item = known.Copy();
}
return item;
};
}
}

View File

@ -42,7 +42,7 @@ namespace Oshima.FunGame.OshimaModules
{
return (id, name, args) =>
{
Skill? skill = id switch
return id switch
{
(long)MagicID. => new (),
(long)MagicID. => new (),
@ -99,13 +99,6 @@ namespace Oshima.FunGame.OshimaModules
(long)ItemActiveID. => new (),
_ => null
};
if (skill is null && KnownSkills.Values.FirstOrDefault(i => i.Id == id) is Skill known)
{
skill = known.Copy();
}
return skill;
};
}