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

Crash when reloading with charcoal directly from charcoal kiln #56479

Merged
merged 1 commit into from
Apr 9, 2022

Conversation

RoyBerube
Copy link
Contributor

@RoyBerube RoyBerube commented Mar 30, 2022

Summary

Bugfixes "Crash when reloading with charcoal directly from charcoal kiln"

Purpose of change

Fixes #56423

When reloading charcoal directly from a charcoal kiln it would leave a 0 quantity piece of charcoal in place and then would cause a crash when accessing that piece of charcoal. Also would place a pseudo item in the smoking rack and cause problems.

Steps to reproduce:

  1. Make charcoal in charcoal kiln.
  2. Inspect the kiln to remove the charcoal. Leave it in place on the kiln position.
  3. Reload a smoking rack within crafting distance of the kiln, using the charcoal at the kiln.
  4. Empty piece of charcoal on the kiln will cause crash if player tries to interact with it.

Describe the solution

map::use_charges() was accessing the furniture item first to get the charcoal. This would also return the pseudo item, which would get inserted into the smoker. Since no other call to this method was using the return value, this problem never manifested before.

The solution was just to swap the order of two sections of code to check the map before furniture. With the map being processed first it does not return the furniture pseudo item.

Describe alternatives you've considered

Testing

Tested with smoker and charcoal kiln. No issues noticed.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 30, 2022
@shenmuyunzhuang
Copy link

In the version of April 8, this bug still exists

@kevingranade kevingranade merged commit 6d29085 into CleverRaven:master Apr 9, 2022
@RoyBerube RoyBerube deleted the smoke-rack-dupe branch April 9, 2022 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Charcoal forge issue?
3 participants