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

Make invalid items unusable #7506

Merged
merged 14 commits into from
Nov 15, 2024

Conversation

kphoenix137
Copy link
Collaborator

@kphoenix137 kphoenix137 commented Nov 3, 2024

Stops players from equipping illegal items and removes the bonuses of already equipped illegal items when the game recalculates equipped items (for loading players with existing illegal items).

The definition of illegal items are any items that would fail existing multiplayer item validation, resulting in the "invalid packet" message or preventing a game join.

This creates a situation where debug build begins creating items that the developer cannot equip, however one can easily override this check. I believe it's better that way, as it prevents non-developers from utilizing debug build for cheating purposes.

The necessity for this comes from a recent Discord discussion, where a legitimate player was given an illegal item prior to the implementation of item validation. As there was no indication this item was illegal, this caused the player to end up unable to join games and unaware why.

Desktop.2024.11.03.-.15.23.21.50.mp4

@AJenbo AJenbo changed the title Make illegal items unusable Make invalid items unusable Nov 4, 2024
Source/CMakeLists.txt Outdated Show resolved Hide resolved
Source/items.cpp Outdated Show resolved Hide resolved
Copy link
Member

@AJenbo AJenbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it so that this is triggered when the is loaded so that it is reflected in the hero menu and doesn't require that they first interact with there gear like in the second video?

@AJenbo AJenbo added this to the 1.6.0 milestone Nov 4, 2024
@kphoenix137
Copy link
Collaborator Author

Can we make it so that this is triggered when the is loaded so that it is reflected in the hero menu and doesn't require that they first interact with there gear like in the second video?

I'll look into that but it's a good idea

@kphoenix137
Copy link
Collaborator Author

Would it be advantageous to create a new item struct variable that's similar to iStatFlag, but for item validity? Then we can have the game treat it a little differently, such as display text in the item box signaling the item is invalid, and perhaps a different character voice line?

@kphoenix137
Copy link
Collaborator Author

Additionally, what are the thoughts on treating items as invalid if 2 of the exact same item data are found in the inventory? For example, if someone duplicates a ring, one of the rings will temporarily become unusable while both exist in the inventory. Removing either copy from the inventory would render the existing one once again usable.

In Diablo, this would only affect rings, as it's the only type of item you can equip 2 of simultaneously. In Hellfire, this would prevent Bard from using 2 duplicate weapons. When players die due to monsters, wearing duped items can create a situation anyway where one of the items get deleted.

@AJenbo
Copy link
Member

AJenbo commented Nov 6, 2024

Additionally, what are the thoughts on treating items as invalid if 2 of the exact same item data are found in the inventory?

Lets keep that for a later PR. This one ha a good size and only minor changes are needed for it to get merged. It's also unclear how we should handle legit duplicates. This seems a bit more complex and would have little benefit.

Would it be advantageous to create a new item struct variable that's similar to iStatFlag, but for item validity? Then we can have the game treat it a little differently, such as display text in the item box signaling the item is invalid, and perhaps a different character voice line?

I think it's going overboard, they shouldn't really be a feature :D

@kphoenix137 kphoenix137 marked this pull request as draft November 12, 2024 03:39
@kphoenix137
Copy link
Collaborator Author

kphoenix137 commented Nov 12, 2024

Town sourced items exceeding maximum vendor prices are no longer deleted, but made unusable instead.

@kphoenix137 kphoenix137 marked this pull request as ready for review November 12, 2024 03:46
Source/items.h Outdated Show resolved Hide resolved
Source/items/validation.cpp Outdated Show resolved Hide resolved
Source/player.h Outdated Show resolved Hide resolved
@AJenbo AJenbo merged commit cfac786 into diasurgical:master Nov 15, 2024
23 checks passed
@kphoenix137 kphoenix137 deleted the illegal-items-unusable branch November 15, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants