Add actions

This commit is contained in:
2023-12-17 09:06:14 +01:00
parent 5c1859cf1b
commit 4f2ac9a0eb
14 changed files with 213 additions and 31 deletions

View File

@@ -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;
}
}