mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-12-05 08:09:04 +00:00
移除 Copy 调用,防止无限递归
This commit is contained in:
parent
22889598ec
commit
79cf4decb5
@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user