Limit how many workers can harvest the same resource
This commit is contained in:
@@ -3,6 +3,13 @@
|
||||
#include "../game_state.h"
|
||||
#include "../ai_actions.h"
|
||||
|
||||
void resetHarvestCount(ecs_iter_t *it) {
|
||||
Harvestable *harvestable = ecs_field(it, Harvestable, 1);
|
||||
|
||||
for (i32 i = 0; i < it->count; i++) {
|
||||
harvestable[i].harvestCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void updateAISystem(ecs_iter_t *it) {
|
||||
Game *game = ecs_singleton_get_mut(ECS, Game);
|
||||
|
||||
Reference in New Issue
Block a user