Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayerData changes #2946

Open
wants to merge 5 commits into
base: general-devel
Choose a base branch
from

Conversation

AgaSpace
Copy link
Contributor

@AgaSpace AgaSpace commented May 14, 2023

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.

AgaSpace added 4 commits May 14, 2023 10:30
Added a new constructor with a parameter that is responsible for installing TShock items into inventory.

The `TSPlayer` parameter was not used, so I labeled the constructor obsolete.
Removed the ability to call a method when a slot less than 0 is specified.

Added an overload that takes `NetItem` in parameters.
QuiCM
QuiCM previously approved these changes Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants