Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

PlayerData changes #2946

Open AgaSpace opened 1 year ago

AgaSpace commented 1 year ago

I noticed that the PlayerData constructor has a TSPlayer parameter, but it's not used, so I marked it obsolete and added a new constructor that has the includingStarterInventory parameter. The bool includingStarterInventory parameter is needed to add items from the SSC config. In the same way, I noticed that there is a check for the maximum slot (if (slot > (this.inventory.Length - 1))), but no check for the minimum: slot < 0. So I changed the condition in the StoreSlot method to: if (slot > (this.inventory.Length - 1) || slot < 0)

Added overloaded "StoreSlot" method that takes the NetItem parameter.