Fix ID Ordering in New Content Creation #2
+19
−10
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.
This pull request addresses an issue where newly generated IDs were not following the correct order, which caused inconsistencies and sometimes led to list errors.
Correction in the SaveStaticDataProtobufBinaryFile Method:
1. Before: The SaveStaticDataProtobufBinaryFile method was incorrectly set up as a get property, which caused a compilation error.
3. Now: It has been corrected to be a regular function that returns a bool, allowing the data to be saved properly. This change was applied in the following part:
Adjustment to GlobalLastCreatureId Increment in the LoadStaticDataProbufBinaryFileFromPath Method:
1. Before: GlobalLastCreatureId didn’t reliably update to reflect the highest existing ID for monsters and bosses, leading to potential duplicates when creating new monsters or bosses.
2. Now: GlobalLastCreatureId is reset to 0, and the method iterates through all monsters and bosses to find the highest ID, ensuring unique IDs when adding new monsters or bosses.
The update occurs in the following section: