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

Don't call item::put_in on full brass catcher #44601

Merged
merged 1 commit into from
Oct 4, 2020

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

Fixes #44151
The brass catcher would overflow and print a message when it did so.

Describe the solution

Check if the brass catcher had room for a casing before attempting to insert it.

Describe alternatives you've considered

A more invasive fix was attempted in #44155, but at the end of the day I don't like the approach of silencing the check if the caller claims to handle it instead of insisting that the caller should always insure that the insertion will succeed.

Testing

Spawned a gun, attacked a brass catcher, fired it until the brass catcher filled up and started dropping casings on the ground.

@esotericist esotericist merged commit 1311d59 into CleverRaven:master Oct 4, 2020
@mqrause
Copy link
Contributor

mqrause commented Oct 4, 2020

Just wanted to mention I did not do it like this because can_contain does the exact same checks that put_in already does.

@anothersimulacrum anothersimulacrum added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` labels Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brass Catcher gives error on overflow
4 participants