Polish up AI

This commit is contained in:
2024-02-13 19:01:51 +01:00
parent 417cf081d7
commit dcd4d1940d
6 changed files with 40 additions and 22 deletions

View File

@@ -263,8 +263,12 @@ void inputUnitAction(Game *game, InputState *input) {
for (i32 i = 0; i < unitIdx; i++) {
ecs_entity_t entity = entities[i].entity;
setAIBehaviour(entity, game->BTs.unit, &(AIBlackboard) {
BzBTNode *BT = game->BTs.unit;
if (ecs_has(ECS, entity, Worker))
BT = game->BTs.unitEvasive;
setAIBehaviour(entity, BT, &(AIBlackboard) {
.moveToPos = positions[i],
.shouldMoveTo = true,
.proximity = 1.0f,
});
}