Repository navigation
Drop the space the port inserted into two-digit weapon file numbers - #218
Closed
IvanPerrella wants to merge 1 commit into
Closed
IvanPerrella wants to merge 1 commit into
IvanPerrella wants to merge 1 commit into
Conversation
The original builds weapon file names with "%2d" for indices from ten up, which pads nothing, but ItemPaths and WeaponNames inserted a space there. Opening a big treasure box with such a weapon loaded "c01w 33.img", found nothing and crashed in EnterIMGFile; the weapon menu looked for "c01w 34.cfg" and built no model, leaving only the character's shadow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing: f510a66 on master already drops the space in both ItemPaths and WeaponNames. |
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.
Summary
Two native-port path builders from 98580bd mistranslated the original's
sprintf(number, "%2d", n)for weapon indices from ten up:"%2d"pads nothing at that width, but the port inserted a space.ItemPaths(port/src/btitem.cpp): opening a big treasure box with such a weapon loadeddun/item/main_wep/c01w 33.img. The file doesn't exist, so the texture buffer stayed empty, andEnterIMGFileread a garbage offset and crashed (0xC0000005).WeaponNames(port/src/menu_misc.cpp): the weapon menu looked forc01w 34.cfginside the weapon pack.LoadPackData3found nothing and built no model, so the menu showed only the character's shadow (e.g. Toan's Sax).Both now only add the leading zero below ten, matching
makeWeaponNameandBtGetWeaponNamePath2inps2/src/btmisc.cpp. Those two are the only padded-number file names in the original code.Backtrace (windows-x64-release, PAL, from the crash minidump)
TreasureboxBig_itemNowas 290 (Bone Rapier, Toan's weapon 33).Test plan
build.bat windows-x64andbuild.bat windows-x64-releasebuild on Windows 11dun/item/main_wep/*.mds/.img, and everycommenu/weapon/*.chrcontains the.cfgnameWeaponNamesnow builds (111 of 111). The only slots with no files are the unused "Dummy"/unnamed ones.🤖 Generated with Claude Code