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
|
|
@ -268,7 +268,7 @@ namespace Server.Engines.Harvest
|
|||
{
|
||||
try
|
||||
{
|
||||
return ActivatorUtil.CreateInstance(type) as Item;
|
||||
return type.CreateInstance<Item>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -387,16 +387,17 @@ namespace Server.Engines.Harvest
|
|||
|
||||
if (res == resource && res.Types.Length >= 3)
|
||||
{
|
||||
var map = from.Map;
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var map = from.Map;
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ActivatorUtil.CreateInstance(res.Types[2], 25) is BaseCreature spawned)
|
||||
var spawned = res.Types[2].CreateEntityInstance<BaseCreature>(25);
|
||||
if (spawned != null)
|
||||
{
|
||||
var offset = Utility.Random(8) * 2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue