Fix for missing items & water containers stacking#28
Open
nikkehsolaris wants to merge 3 commits into
Open
Conversation
Adds fixes for water containers stacking & losing water; plus a larger fix for net new items.
added in Isaiah's fix for the 2 commands as well
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.
StackSizeController — 4.1.4 patch
Fixes stateful items being made stackable, and items missing from the (stale) repo
vanilla-defaults.jsonbeing mis-anchored or crashing commands.Problems
Liquid containers stack and dupe/lose contents.
_ignoreListonly protected theliquid unit items (
water,water.salt), not the containers that hold a variableamount of liquid as sub-state. Any global/category multiplier therefore resized
waterjug,botabag,smallwaterbottle,bucket.water, and the water guns.New items have no fixed vanilla anchor.
DownloadVanillaDefaults()re-downloads therepo
vanilla-defaults.jsonand overwrites the local datafile on every load. Therepo file is stale, so items added by newer Rust updates (e.g.
hazmatsuit.pilot) areabsent. For any missing item,
GetVanillaStackSize()falls back to the item's livestackable, which on a reload is the already-modified value — so it gets multipliedagain and compounds, and the inflated value gets persisted into
IndividualItemStackSizein the config.Commands crash on unknown items.
ItemSearchCommandandListCategoryItemsCommandindexed
_vanillaDefaults[shortname]directly, throwingKeyNotFoundExceptionfor anyitem not present in the defaults file.
Changes
waterjug,botabag,smallwaterbottle,bucket.water,gun.water,pistol.waterto_ignoreList.UpdateVanillaDefaultsFromRepo(defaultfalse). When false, thelocally-maintained
<plugin>_vanilla-defaultsdatafile is used and never overwritten bythe repo copy. The repo is still fetched once on first install (no local file) as a
bootstrap, or always when the option is set to
true._vanillaDefaults[...]indexer withGetVanillaStackSize()in bothlisting commands so missing items no longer crash them.
displayName/displayDescriptionin
ItemSearchCommand(null on some item definitions →NullReferenceException), andguard the
CategoryStackMultiplierslookup withContainsKeyinListCategoryItemsCommand. Same 4.1.4 version bump.4.1.4with an explanatory header comment.Docs
README.mdto match 4.1.4: new "Protected Items" section; corrected the stale"datafiles are no longer used" note (this fork does use the local vanilla-defaults
datafile, now authoritative); documented
UpdateVanillaDefaultsFromRepoin both configblocks and the field list; documented the
stacksizecontroller.vdcommand and apost-update regeneration workflow; expanded the
AllowStackingItemsWithDurabilityguidance; added a changelog. Version bumped to 4/1/4 in the sample configs.
Server-owner steps (not code — recommended alongside this patch)
AllowStackingItemsWithDurabilitytofalsein the config so armor/weapons/tools(anything with durability, i.e. attachment/condition sub-state) revert to vanilla stacks
and stop duping.
GlobalStackMultiplierand every
CategoryStackMultipliersentry to1, reload, runstacksizecontroller.vd,then restore your multipliers. With
UpdateVanillaDefaultsFromRepofalse, that generatedfile is now authoritative and won't be clobbered.
IndividualItemStackSizein the config for any newer items already sitting at aninflated number (e.g.
hazmatsuit.pilot) and correct or delete those entries —Populateonly adds missing keys, it never re-reads existing ones.
stacksizecontroller.vd(multipliers at 1) after each wipe/game update to pick upnewly added items.
Why? This was causing issues on my server & I had time to debug it with Claude.