Add walk animation
This commit is contained in:
@@ -112,17 +112,17 @@ void inputUnitAction(Game *game, InputState *input) {
|
||||
if (isInputBtnJustUp(input, actionBtn)) {
|
||||
// Note: We mustn't use ecs ecs_remove_all since this will also
|
||||
// remove ongoing paths that are not part of this query.
|
||||
iterateSelectedUnits(input->queries.selected, iterRemovePaths);
|
||||
ecs_defer_begin(ECS);
|
||||
iterateSelectedUnits(query, iterRemovePaths);
|
||||
ecs_defer_end(ECS);
|
||||
|
||||
const Position target = input->mouseWorld;
|
||||
|
||||
ecs_iter_t it = ecs_query_iter(ECS, query);
|
||||
ecs_defer_begin(ECS);
|
||||
while (ecs_iter_next(&it)) {
|
||||
const Position *pos = ecs_field(&it, Position, 1);
|
||||
for (i32 i = 0; i < it.count; i++) {
|
||||
const ecs_entity_t entity = it.entities[i];
|
||||
|
||||
entitySetPath(entity, target, game);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user