Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some "_id" fields not being unique. (#17)
* Fix "_id" fields not being unique. The field not being unique may cause issues with the difference checker, as it just randomly decides the order of certain objects, causing false positives in difference checkers. - Make the "_id" fields use more than just the name, as duplicate names are possible in the cases of enemies. - Add an "_id" field to transients and refactor the file a bit. These are the only current files that have ambiguity, but there may be more cases of this issue possible later (think items, primarily). Might need to improve the "_id" field of those later, too. For now, however, this suffices. * Manual regeneration of the 2018-05-17 17:00 droptables. * Update README to add the transient "_id" field. * Concat strings and remove redundant null JSON properties. * Manual regeneration of the 2018-05-17 17:00 droptables. * Resolve duplicate _id fields still occurring. Reverts the dynamic salt in 90% of the cases, so comparisons can be more easily made. Now, when the same ID has been found in an array, try to hash it with some properties until giving up eventually and just skipping adding the object when it's the _exact_ same. This applies to enemyModTables.js and modLocations.js, as those are the currently known cases of duplicates occurring. Also refactors the other files having inconsistent formatting. * Manual regeneration of the 2018-05-17 17:00 droptables. * Revert "ememy" fix for now and decrease amount of _id changes. This reverts my previous fix for ememy > enemy for now and discards all changes to the object already in the array when all previous checks fail. This causes less removals and additions when just de-duplicating the array as the original item doesn't get edited at all. * Manual regeneration of the 2018-05-17 17:00 droptables. * Add modular way to check hashes of arrays. Adds checkUniqueHash(items, source, [...properties]) function. Expects "_id" field to exist within the source object, and experts the first property to be the value that's the default hash. * Manual regeneration of the 2018-05-17 17:00 droptables. * var -> let
- Loading branch information
Showing
19 changed files
with
135 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"hash":"888d284f1b3af25d5689af8d252a3106","timestamp":1526569212093,"modified":1526569000000} | ||
{"hash":"888d284f1b3af25d5689af8d252a3106","timestamp":1527275015982,"modified":1526569000000} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.