wake producer when producing items

isolation
Dominik Madarász 2022-09-29 19:39:34 +02:00
parent 6ae7aff24c
commit 686149829e
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ uint64_t device_spawn(asset_id id) {
ecs_entity_t e = entity_spawn(EKIND_DEVICE);
Device *dev = ecs_get_mut(world_ecs(), e, Device);
zpl_zero_item(dev);
dev->asset = id;
return (uint64_t)e;

View File

@ -44,6 +44,10 @@ void ProduceItems(ecs_iter_t *it) {
d[i].progress_active = (producer[i].processed_item > 0);
d[i].progress_value = 1.0f-((producer[i].process_time - game_time()) / game_rules.furnace_cook_time);
if (d[i].progress_active) {
entity_wake(it->entities[i]);
}
}
}