wake producer when producing items
parent
6ae7aff24c
commit
686149829e
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue