Prevent gear OCR from overwriting a gear's type #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
'stype
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.