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
|
|
@ -395,10 +395,11 @@ namespace Server.Engines.CannedEvil
|
|||
{
|
||||
try
|
||||
{
|
||||
prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!
|
||||
var scrollDupe = scroll.GetType().CreateEntityInstance<SpecialScroll>();
|
||||
|
||||
if (ActivatorUtil.CreateInstance(scroll.GetType()) is SpecialScroll scrollDupe)
|
||||
if (scrollDupe != null)
|
||||
{
|
||||
prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!
|
||||
scrollDupe.Skill = scroll.Skill;
|
||||
scrollDupe.Value = scroll.Value;
|
||||
prot.AddToBackpack(scrollDupe);
|
||||
|
|
@ -619,7 +620,7 @@ namespace Server.Engines.CannedEvil
|
|||
|
||||
try
|
||||
{
|
||||
Champion = ActivatorUtil.CreateInstance(ChampionSpawnInfo.GetInfo(m_Type).Champion) as Mobile;
|
||||
Champion = ChampionSpawnInfo.GetInfo(m_Type).Champion.CreateInstance<Mobile>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -782,7 +783,7 @@ namespace Server.Engines.CannedEvil
|
|||
{
|
||||
try
|
||||
{
|
||||
return ActivatorUtil.CreateInstance(types.RandomElement()) as Mobile;
|
||||
return types.RandomElement().CreateInstance<Mobile>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue