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

Prevent gear OCR from overwriting a gear's type #93

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

apache1123
Copy link
Owner

Bug may have been introduced in 3.0.0.
The gear OCR feature can take any gear screenshot and overwrite the current gear with whatever gear is in that screenshot. It meant that a gear piece's gear type can be overwritten, resulting in an incorrect data state.

Prevent this by saving the OCR gear into the correct gear slot in the gear set, instead of overwriting the gear outright.
Also, prevent a Gear's type to be changed.

Data fix for potential issue with gear sets gear type data that may have been introduced in 3.0.0.

A gear set's structure looks something like this:
{ gearsByTypeId: { Helmet: { id: ..., type: 'Helmet', randomStats: ... }, Eyepiece: { id: ..., type: 'Eyepiece', randomStats: ... } }}

In gear comparer's gear OCR feature, a gear's type can be overwritten, causing an issue where a gear of a different type can be in a gearsByTypeId slot of another type.

e.g. { gearsByTypeId: { Helmet: { id: ..., type: 'Eyepiece', randomStats: ... }, Eyepiece: { id: ..., type: 'Eyepiece', randomStats: ... } }}

Fix this by identifying the incorrect gears and resetting them to an empty gear of the correct type.

Copy link

vercel bot commented Dec 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
tof-tools ✅ Ready (Inspect) Visit Preview Dec 7, 2023 8:08am

@apache1123 apache1123 merged commit d442ec4 into main Dec 7, 2023
1 check passed
@apache1123 apache1123 deleted the fix-import-gear-gear-type branch December 7, 2023 08:33
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.

1 participant