[H] fix pocketdata#266
Conversation
Rewrite tools/fix_pocket_data_volume_limits.py to bump pocket max_contains_volume values up to an object's own top-level volume instead of only targeting specific 20L/20kg pockets. The script no longer requires strict JSON parsing and operates text-preservingly (handles CDDA-style files with comments/trailing commas), scans files/directories recursively, and skips objects with a local TARDIS flag. Added options: --safety-gap-ml, --update-weight (optional realistic max_contains_weight update using --kg-per-liter), --force-all-pockets, and --formatter to run a post-write formatter. Internal changes include regex-based parsing, top-level object/pocket range detection, new FixStats dataclass for reporting, improved unit parsing/formatting helpers, dry-run support, and updated log filename and output messages.
Normalize volume/weight representations across multiple item JSONs: replace many max_contains_volume/max_contains_weight ml/g string values with standardized units (e.g. "20 L" / "20 kg") in Aftershock, Generic_Guns and Xedra_Evolved items; convert artifact weight strings like "1 g" to numeric values (1); and fix activity_noise.volume to numeric values. These changes unify types/units for pockets, magazines and artifact weights to avoid inconsistent parsing.
Replace varied "max_contains_volume" and "max_contains_weight" ml/g values with standardized "20 L" and "20 kg" for MAGAZINE_WELL and related pockets across many mod item files. This normalizes capacity/weight limits for magazines, batteries and holsters to remove inconsistencies and simplify balancing across mods.
|
Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters. If you still want a review, comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1d5ce5423
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "pocket_type": "MAGAZINE_WELL", | ||
| "holster": true, | ||
| "max_contains_volume": "499 ml", | ||
| "max_contains_volume": "20 L", |
There was a problem hiding this comment.
Keep non-TARDIS pocket volume under the item volume
This changes the Browning Hi-Power's magazine-well pocket from just under its own volume (500 ml, line 16) to 20 L without adding TARDIS or increasing the item volume. In the same repo, tools/storage_to_pocket_data.py documents that converted pockets must keep the item's outside volume larger than the pocket capacity to avoid needing TARDIS, so loading this mod can fail validation for this and the other similarly changed guns whose pockets now exceed their item volumes by orders of magnitude.
Useful? React with 👍 / 👎.
No description provided.