Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent debugmsg while refilling liquid container with another one #4010

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8248,8 +8248,11 @@ bool item::reload( player &u, item &loc, int qty )
}
}

// we have transfered ammo from the container to the item
// therefore, we erase the 0-charge item inside container
// TODO: why don't we just remove 0-charge items?
if( ammo->charges == 0 && !ammo->has_flag( flag_SPEEDLOADER ) ) {
if( container != nullptr ) {
if( container != nullptr && !container->contents.empty() ) {
container->remove_item( container->contents.front() );
u.inv_restack( ); // emptied containers do not stack with non-empty ones
} else {
Expand Down
Loading