diff options
Diffstat (limited to 'ia.c')
-rw-r--r-- | ia.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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); } |