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
|
|
@ -55,7 +55,7 @@ namespace Server
|
|||
{
|
||||
if (weight < item.Weight)
|
||||
{
|
||||
var obj = item.Construct();
|
||||
var obj = item.Type.CreateInstance<Item>();
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
|
|
@ -188,8 +188,6 @@ namespace Server
|
|||
public int Weight { get; }
|
||||
|
||||
public Type Type { get; }
|
||||
|
||||
public Item Construct() => ActivatorUtil.CreateInstance(Type) as Item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace Server.Factions
|
|||
{
|
||||
try
|
||||
{
|
||||
return ActivatorUtil.CreateInstance(TrapType, m_Faction, from) as BaseFactionTrap;
|
||||
return TrapType.CreateInstance<BaseFactionTrap>(m_Faction, from);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue