Fixes dupe exception (#258)
- [X] Cleans up ActivatorUtil - [X] Fixes dupe exception - [X] Fixes a bug in BasePotion - [X] Fixes a few possible memory leaks Bumps release version
This commit is contained in:
parent
4d6e584b6c
commit
e9c1e4cbba
66 changed files with 597 additions and 496 deletions
|
|
@ -780,7 +780,7 @@ namespace Server
|
|||
|
||||
try
|
||||
{
|
||||
return ActivatorUtil.CreateInstance(type) as Item;
|
||||
return type.CreateInstance<Item>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1066,7 +1066,7 @@ namespace Server
|
|||
}
|
||||
else
|
||||
{
|
||||
item = ActivatorUtil.CreateInstance(Type) as Item;
|
||||
item = Type.CreateInstance<Item>();
|
||||
}
|
||||
|
||||
return item;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ namespace Server
|
|||
|
||||
public static void GiveArtifactTo(Mobile m)
|
||||
{
|
||||
if (!(ActivatorUtil.CreateInstance(Artifacts.RandomElement()) is Item item))
|
||||
var item = Artifacts.RandomElement().CreateInstance<Item>();
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue