Add actions
This commit is contained in:
@@ -83,7 +83,13 @@ void inputUnitAction(Game *game, InputState *input) {
|
||||
while (ecs_query_next(&it)) {
|
||||
for (i32 i = 0; i < it.count; i++) {
|
||||
const ecs_entity_t entity = it.entities[i];
|
||||
ecs_set(ECS, entity, HarvestTask, {taskEntity});
|
||||
const Position target = *ecs_get(ECS, taskEntity, Position);
|
||||
addAction(entity, game, &(const Action) {
|
||||
.type = ACTION_MOVE_TO,
|
||||
.as.moveTo.target = target,
|
||||
.as.moveTo.proximityThreshold = 10.0f,
|
||||
});
|
||||
//ecs_set(ECS, entity, HarvestTask, {taskEntity});
|
||||
goto while_break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user