Added backwards compatibility for SSC
This commit is contained in:
parent
e5cbee82e9
commit
23ab14df4f
2 changed files with 10 additions and 2 deletions
|
|
@ -80,6 +80,14 @@ namespace TShockAPI.DB
|
|||
List<NetItem> inventory = reader.Get<string>("Inventory").Split('~').Select(NetItem.Parse).ToList();
|
||||
if (inventory.Count < NetItem.MaxInventory)
|
||||
{
|
||||
//TODO: unhardcode this - stop using magic numbers and use NetItem numbers
|
||||
//Set new armour slots empty
|
||||
inventory.InsertRange(67, new NetItem[2]);
|
||||
//Set new vanity slots empty
|
||||
inventory.InsertRange(77, new NetItem[2]);
|
||||
//Set new dye slots empty
|
||||
inventory.InsertRange(87, new NetItem[2]);
|
||||
//Set the rest of the new slots empty
|
||||
inventory.AddRange(new NetItem[NetItem.MaxInventory - inventory.Count]);
|
||||
}
|
||||
playerData.inventory = inventory.ToArray();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue