summaryrefslogtreecommitdiff
path: root/ia.c
diff options
context:
space:
mode:
Diffstat (limited to 'ia.c')
-rw-r--r--ia.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ia.c b/ia.c
index 0844339..3b5d3f4 100644
--- a/ia.c
+++ b/ia.c
@@ -39,16 +39,18 @@ void ai_play_turn(struct action_params_t *params)
/* XXX complete brainless articial intelligence */
struct team_t *target_team;
- struct character_t *target;
+ struct target_t target;
+
+ target.is_chr = true;
target_team = (params->src->team == params->t1) ? params->t2 : params->t1;
- target = ai_find_random_target(target_team);
+ target.chr = ai_find_random_target(target_team);
- if (target == NULL) {
+ if (target.chr == NULL) {
/* do nothing, everyone is dead */
return;
}
- attack(params->surfaces, params->positions, params->src, target, NULL);
+ attack(params->surfaces, params->positions, params->src, &target, NULL);
}