diff options
Diffstat (limited to 'jouer.c')
-rw-r--r-- | jouer.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -110,12 +110,13 @@ static void update_current_character(struct team_t *t1, struct team_t *t2, struc static enum action_state_t select_target(struct action_params_t *params, void *data, - void (*cb)(SURFACES *, POSITIONS *, struct character_t *, struct character_t *, void *)) + void (*cb)(SURFACES *, POSITIONS *, struct character_t *, struct target_t *, void *)) { SURFACES *surfaces = params->surfaces; POSITIONS *positions = params->positions; /* select our own character because he exists no matter what */ struct team_t *target_team = params->src->team; + struct target_t target; int selection = target_team->chr_cur; int new_selection; SDL_Event event; @@ -172,9 +173,12 @@ enum action_state_t select_target(struct action_params_t *params, void *data, break; case SDLK_RETURN: case SDLK_f: + target.is_chr = true; + target.chr = &target_team->chrs[selection]; + update_selected_target(surfaces, positions, NULL); - (*cb)(surfaces, positions, params->src, &target_team->chrs[selection], data); + (*cb)(surfaces, positions, params->src, &target, data); return ACTION_PERFORMED; default: |