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

"using" field doesn't work as intended for construction recipe #34191

Closed
Fris0uman opened this issue Sep 22, 2019 · 2 comments · Fixed by #34533
Closed

"using" field doesn't work as intended for construction recipe #34191

Fris0uman opened this issue Sep 22, 2019 · 2 comments · Fixed by #34533
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing

Comments

@Fris0uman
Copy link
Contributor

Describe the bug

None of the construction recipe using "using" are loaded properly.
See Workbench or Dumpster: they can be build with no tool at all.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Start Game
  2. Press *
  3. Look at workbench
  4. Need no tool
  5. Check recipe in json
  6. Recipe is correct

Expected behavior

This should work "using": [ [ "welding_standard", 15 ] ],
But the code can actually only handle "using": "welding_standard",

Additional context

requirement is only a requirement_id in construction.h instead of std::vector<std::pair<requirement_id, int>> in recipe.h

@Night-Pryanik Night-Pryanik added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Sep 23, 2019
@lazho
Copy link
Contributor

lazho commented Oct 7, 2019

On further investigation, when a construction recipe has something like "using": "welding_standard", all other requirements specified through tools, components, and qualities are ignored as well. This makes any recipe using the "singular" form of using basically free in terms of material cost (fortunately, none exist right now)

this is the current logic:

if there is a using requirement in the "singular" form,
    set this construction's requirement to that one.
else,
    load a requirement using `tools`, `qualities`, `components`.

This completely ignores things like "using": [ [ "welding_standard", 5 ] ], since only things like "using": "welding_standard" are caught by this if statement.

@lazho
Copy link
Contributor

lazho commented Oct 7, 2019

PR is currently blocked by the fact that requirements/toolsets.json loads after construction.json, even though the construction recipes depend on requirements in that file. Any ideas?

Edit: I've solved the problem by adding the "using" stuff during finalize_construction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants