fix producer creating extra item
parent
3f30bb5079
commit
0f12724700
|
@ -29,12 +29,13 @@ void ProduceItems(ecs_iter_t *it) {
|
||||||
const Ingredient *ing = 0;
|
const Ingredient *ing = 0;
|
||||||
if ((ing = ecs_get_if(it->world, item_slot_ent, Ingredient))) {
|
if ((ing = ecs_get_if(it->world, item_slot_ent, Ingredient))) {
|
||||||
if (ing->producer == d->asset) {
|
if (ing->producer == d->asset) {
|
||||||
producer[i].processed_item = ing->product;
|
|
||||||
producer[i].process_time = game_time() + game_rules.furnace_cook_time;
|
|
||||||
item->quantity--;
|
item->quantity--;
|
||||||
if (item->quantity <= 0) {
|
if (item->quantity <= 0) {
|
||||||
item_despawn(item_slot_ent);
|
item_despawn(item_slot_ent);
|
||||||
storage[i].items[j] = 0;
|
storage[i].items[j] = 0;
|
||||||
|
} else {
|
||||||
|
producer[i].processed_item = ing->product;
|
||||||
|
producer[i].process_time = game_time() + game_rules.furnace_cook_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue