Skip to content

Conversation

@shmakota
Copy link
Collaborator

@shmakota shmakota commented Jul 26, 2025

Purpose of change (The Why)

This PR reopens the work done by @chaosvolt in #4893. I am hoping by reopening this we can get more eyes on it as Chaos had a great deal of the work already done.

This aims to finally allow loading containers at will with any available solid ammo or comestibles. WIP for now as it's turning out to be a fair bit more complicated than last reload-related PR I did, I wanted to be able to set it aside to work with intermittently.

Describe the solution (The How)

To be filled out when completed.

Currently replaces a bunch of is_watertight_container() checks with is_container() and relevant logic statements where additional changes are needed.

Describe alternatives you've considered

Screaming.

Testing

Testing to ensue as implementation does. Right now it compiles but proper interaction of reload command isn't fully functional yet.

The game seems to compile and I can successfully load a single protein ration or flour into a jar, however subsequent attempts seem to cause the debugmsg below. Note that when the player doesn't have a backpack, 99 flour tumbles to the floor. Unloading seems to work properly as of now.

Attempting to load a cardboard box with flour or protein rations however, causes the item to spit out the completed reload message, without actually reloading the item at all. I suspect this has to do with is_watertight_container() checks somewhere, but haven't been able to track it down yet.

Additional context

image image image

Note that Chaos seemed to report this as the error before: #4893 (comment). I belive this has been fixed as of his commit: 7366066 and that is where this PR begins from.
Resolves #563.

Checklist

Mandatory

Co-Authored-By: Chaosvolt <[email protected]>
@github-actions github-actions bot added the src changes related to source code. label Jul 26, 2025
@shmakota
Copy link
Collaborator Author

shmakota commented Sep 7, 2025

Note that I made slight progress on this, however it was through a hack. In item::reload() we can specify the qty directly which we can set to 999 to load the jar with as many charges of flour as possible. This is not the intended behavior, however, and should be fixed to properly check how many charges of the item can fit into the container like liquid properly does. Also note that for a "CONTAINER" item to work to hold anything, it currently needs the seals parameter defined as true. Watertight can be either true or false.

WishDuck and others added 2 commits October 9, 2025 20:16
@chaosvolt
Copy link
Member

Tested it, one flaw still remains. You can try to reload a cardboard box, which it probably should allow you to load solids into, and it tries to but then doesn't actually do anything. It blips a reloading activity indicator but then you check and the box is still empty:
image

@chaosvolt
Copy link
Member

Oddity, solids loaded in a container show up twice in the reload menu.
image

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird issue: you can only reload a non-watertigh container with solids ONCE, then it claims to be full:
image

Glass jar doesn't have this issue and lets me put more flour in it if it's partially full, so seems to be an issue with non-watertight containers.

@WishDuck WishDuck mentioned this pull request Oct 21, 2025
49 tasks
Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Refilling a solid container from another container only fills it one unit at a time, unlike with reloading it with loose solids where it grabs the entire available stack.
  2. This can also still trigger the "solid contents show up on the menu twice" issue.
image image image

Trying to load an empty container with alread-contained solids always only loads one. Picking <container>, inventory likewise only loads one, while picking inside <item> (<container>) will grab all of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JSON related to game datas in JSON format. src changes related to source code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to reload barrel with Black Gunpowder Reload a container to fill it with items

3 participants