Repository navigation
Conversation
RESTEST loaded its list with RES_UNKNOWN, so an item given by number (01034, or a def holding a hex ID) failed with 'Bad resource list id' and returned 0, while RESCOUNT reads it as an item. CResourceQtyArray::Load takes the type to give to bare IDs; RESTEST passes RES_ITEMDEF, the other resource lists keep the old behaviour. Fixes Sphereserver#1430 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes #1430.
RESTESTloaded its resource list withRES_UNKNOWN, so an item given by number (RESTEST 1 01034, or a def holding a hex ID) failed with "Bad resource list id" and returned 0, whileRESCOUNTreads a number as an item ID (ResourceGetID(RES_ITEMDEF, ...)).CResourceQty::LoadandCResourceQtyArray::Loadtake an optional default type for bare IDs (defaultRES_UNKNOWN, the current behaviour).RESTESTpassesRES_ITEMDEF, likeRESCOUNT; the other resource lists (RESOURCES, SKILLMAKE, ...) are unchanged. A defname still carries its own type (skills, typedefs, etc.), and a bare ID of 0 is still refused with the same error.Note: with two numbers the first one is the quantity ("qty id"), as before.
Type of Change
Related Issues
Fixes #1430
Testing
rescount 01034= 1,restest 1 01034= 1 (was 0 with the error),restest 1 i_saw= 1,restest i_saw 1= 1.Checklist
Additional Notes
None.
🤖 Generated with Claude Code