diff --git a/code/foundation/src/lists/crafting_list.c b/code/foundation/src/lists/crafting_list.c index 40c96a7..6f403f3 100644 --- a/code/foundation/src/lists/crafting_list.c +++ b/code/foundation/src/lists/crafting_list.c @@ -17,7 +17,10 @@ __VA_ARGS__\ } static recipe recipes[] = { - RECIPE(ASSET_BELT, ASSET_FURNACE, 4, R(ASSET_FENCE, 8), R(ASSET_WOOD, 2), {0}), + // NOTE(zaklaus): Belt + RECIPE(ASSET_IRON_PLATES, ASSET_FURNACE, 4, R(ASSET_IRON_ORE, 1), {0}), + RECIPE(ASSET_SCREWS, ASSET_CRAFTBENCH, 8, R(ASSET_IRON_PLATES, 1), {0}), + RECIPE(ASSET_BELT, ASSET_CRAFTBENCH, 1, R(ASSET_FENCE, 1), R(ASSET_SCREWS, 4), R(ASSET_IRON_PLATES, 2), {0}), }; #define MAX_RECIPES (sizeof(recipes)/sizeof(recipes[0])) diff --git a/code/foundation/src/models/crafting.c b/code/foundation/src/models/crafting.c index b25ff48..1be7b8e 100644 --- a/code/foundation/src/models/crafting.c +++ b/code/foundation/src/models/crafting.c @@ -22,6 +22,7 @@ uint32_t craft__find_num_recipes_by_reagent(asset_id producer, asset_id id) { for (int j = 0; recipes[i].reagents[j].id; ++j) { if (recipes[i].reagents[j].id == id) { ++num_recipes; + break; } } } diff --git a/code/foundation/src/systems/modules/system_logistics.c b/code/foundation/src/systems/modules/system_logistics.c index ed258d0..068fac5 100644 --- a/code/foundation/src/systems/modules/system_logistics.c +++ b/code/foundation/src/systems/modules/system_logistics.c @@ -82,7 +82,7 @@ void PushItemsOnNodes(ecs_iter_t *it) { Item *item = item_get_data(item_slot_ent); if (!item) continue; - if (craft_is_reagent_used_in_producer(item->kind, d->asset)) { + if (craft_is_reagent_used_in_producer(item->kind, d[i].asset)) { // NOTE(zaklaus): this is an input reagent, keep it continue; } diff --git a/code/foundation/src/systems/modules/system_producer.c b/code/foundation/src/systems/modules/system_producer.c index 56a8df1..414f0d6 100644 --- a/code/foundation/src/systems/modules/system_producer.c +++ b/code/foundation/src/systems/modules/system_producer.c @@ -32,7 +32,7 @@ void ProduceItems(ecs_iter_t *it) { entity_set_position(e, p[i].x, p[i].y); producer[i].processed_item = 0; } else { - producer[i].processed_item = craft_perform_recipe(storage[i].items, d->asset, &producer[i].processed_item_qty); + producer[i].processed_item = craft_perform_recipe(storage[i].items, d[i].asset, &producer[i].processed_item_qty); producer[i].process_time = game_time() + game_rules.furnace_cook_time; } }