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 in-progress crafting of liquid items to have liquid behaviour #36011

Closed
wants to merge 3 commits into from

Conversation

conghienquoc
Copy link

@conghienquoc conghienquoc commented Dec 10, 2019

Summary

SUMMARY: Bugfixes "Fix in-progress crafting of liquid items to have liquid behaviour"

Purpose of change

Fixes #35863 - if you do not finish crafting liquid, you can drop it and pick it up from the ground.

Describe the solution

  1. In item constructor for crafting items, checks for if the resulting item is of LIQUID phase to determine if the current in-progress crafting item shoudl be of LIQUID phase.
  2. In pick_up_one, add a check for crafting item in LIQUID phase.

Describe alternatives you've considered

If modifying the phase of the recipe item is allowed (it's currently a const pointer), then the added code in pick_up_one is not necessary.

Testing

In-game testing through the debug menu.

src/pickup.cpp Outdated Show resolved Hide resolved
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items / Item Actions / Item Qualities Items and how they work and interact labels Dec 11, 2019
@ZhilkinSerg
Copy link
Contributor

You need to astyle your changes (run make astyle or see #24006 if you are using VS).


// in craft of liquid item should have liquid attribute
if( find_type(making->result())->phase == LIQUID ) {
current_phase = static_cast<phase_id>( 2 );
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
current_phase = static_cast<phase_id>( 2 );
current_phase = LIQUID;

@kevingranade
Copy link
Member

I'm not sure if this does what we want, the recipe acts as a liquid even though any liquid recipes are going to include a container.
For example in the case of the clean water recipe, you need the water, a heat source, and a pot, so the more reasonable assumption is that the intermediate form is a pot full of water rather than treating it as some kind of liquid.

@kevingranade
Copy link
Member

I think the real issue here is mislabelling, an in-progress "clean water" craft is going to be called "in progress clean water", but in reality it's "a pot of in-progress clean water". Basically the behavior is fine, but the description could be clearer about what's happening.

@Feuerhai
Copy link
Contributor

Feuerhai commented Jan 9, 2020

But the "in progress clean water" doesn't have the pot included in the item itself, so you can just store it in a cupboard or something while taking the pot with you.

@ZhilkinSerg
Copy link
Contributor

But the "in progress clean water" doesn't have the pot included in the item itself, so you can just store it in a cupboard or something while taking the pot with you.

Container should be part of incomplete craft and not be available for other activities.

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` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
6 participants