fix: Adds OSI candle/torch functionality, codegens lights (#1075)

This commit is contained in:
Kamron Batman 2022-06-17 23:26:27 -07:00 • committed by GitHub
parent 9c8f73aaf8
commit 41efa69b56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 865 additions and 1219 deletions

View file

@ -5301,12 +5301,12 @@ namespace Server
}
}
public static Item LiftItemDupe(Item oldItem, int amount)
public static T LiftItemDupe<T>(T oldItem, int amount) where T : Item
{
Item item;
T item;
try
{
item = oldItem.GetType().CreateInstance<Item>();
item = oldItem.GetType().CreateInstance<T>();
}
catch
{
@ -5318,6 +5318,9 @@ namespace Server
return null;
}
var oldAmount = oldItem.Amount;
oldItem.Amount = amount;
item.Visible = oldItem.Visible;
item.Movable = oldItem.Movable;
item.LootType = oldItem.LootType;
@ -5329,10 +5332,9 @@ namespace Server
item.Name = oldItem.Name;
item.Weight = oldItem.Weight;
item.Amount = oldItem.Amount - amount;
item.Amount = oldAmount - amount;
item.Map = oldItem.Map;
oldItem.Amount = amount;
oldItem.OnAfterDuped(item);
if (oldItem.Parent is Mobile parentMobile)