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
|
|
@ -72,8 +72,14 @@ namespace Server.Items
|
|||
bool ICommodity.IsDeedable => Core.ML;
|
||||
|
||||
public int OnCraft(
|
||||
int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
|
||||
CraftItem craftItem, int resHue
|
||||
int quality,
|
||||
bool makersMark,
|
||||
Mobile from,
|
||||
CraftSystem craftSystem,
|
||||
Type typeRes,
|
||||
BaseTool tool,
|
||||
CraftItem craftItem,
|
||||
int resHue
|
||||
)
|
||||
{
|
||||
if (craftSystem is DefAlchemy)
|
||||
|
|
@ -151,11 +157,11 @@ namespace Server.Items
|
|||
{
|
||||
if (this is BaseExplosionPotion && Amount > 1)
|
||||
{
|
||||
var pot = (BasePotion)ActivatorUtil.CreateInstance(GetType());
|
||||
var pot = GetType().CreateInstance<BaseExplosionPotion>();
|
||||
|
||||
Amount--;
|
||||
|
||||
if (from.Backpack?.Deleted != false)
|
||||
if (from.Backpack?.Deleted == false)
|
||||
{
|
||||
from.Backpack.DropItem(pot);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Server.Items
|
|||
{
|
||||
if (weapon.UsesRemaining > 0)
|
||||
{
|
||||
var ammo = ActivatorUtil.CreateInstance(weapon.AmmoType, weapon.UsesRemaining) as Item;
|
||||
var ammo = weapon.AmmoType.CreateInstance<Item>(weapon.UsesRemaining);
|
||||
|
||||
if (ammo is INinjaAmmo ninaAmmo)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue