A-Dawn-of-Heroes-NWN-EE-PW / New-Crafting-System

Report your issues with out new Crafting System here!
2 stars 0 forks source link

In a furnace: "Steel or Non-Steel?" #50

Closed BarchamMal closed 10 months ago

BarchamMal commented 10 months ago

Your setup Device platform: MacOS Game version: Same as all my issues. SERVER SIDE!

Describe the bug If you have charcoal and non-steel ores (salt, copper, iron, mithril) in a furnace, they will not smelt. Logical error I think. I wonder if the code goes like this:

if forge.inventory.has_item(charcoal):
    for item in forge.inventory:
        forge.try_to_smelt_recipe(item, charcoal)
else:
    for item in forge.inventory:
        forge.try_to_smelt_recipe(item)

When it should be:

if forge.inventory.has_item(charcoal):
    for item in forge.inventory:
        if not forge.try_to_smelt_recipe(item, charcoal):
            forge.try_to_smelt_recipe(item)
else:
    for item in forge.inventory:
        forge.try_to_smelt_recipe(item)

To Reproduce

  1. Put wood in a furnace to heat it up.
  2. After it is heated, put charcoal and iron in the furnace.
  3. The furnace will cool back down and nothing will get smelted.
Samuel-IH commented 10 months ago

@BarchamMal we need to get you on discord so you can join the team. I swear C# is like Java but better!

BarchamMal commented 10 months ago

that was python.

Samuel-IH commented 10 months ago

Obviously. But I know you know Java.

BarchamMal commented 10 months ago

Oh good.

BarchamMal commented 10 months ago

Was my guess correct?

Samuel-IH commented 10 months ago

No. Charcoal is just part of the recipe.

BarchamMal commented 10 months ago

Then why doesn't iron, salt, or copper smelt when charcoal is in the furnace?

Samuel-IH commented 10 months ago

It was an iteration issue. Looping through an inventory while I'm already looping through the same inventory. Interop stuff.