summaryrefslogtreecommitdiff
path: root/jouer.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-09 22:32:08 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-09 22:32:08 +0100
commitad2bf5cd7c227bf916b51547f61fdfe711f0b4c3 (patch)
tree249df9520804ce4ff8526fdefa81c745c849f7a5 /jouer.c
parentc25e1d6fd68f1f85af9e7f6dd0d35c725000014f (diff)
pass the target type to select_target
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'jouer.c')
-rw-r--r--jouer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/jouer.c b/jouer.c
index 68bfb8c..7c302be 100644
--- a/jouer.c
+++ b/jouer.c
@@ -117,8 +117,7 @@ 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 target_t *, void *))
+enum action_state_t select_target(struct action_params_t *params, const struct action_t *action)
{
SURFACES *surfaces = params->surfaces;
POSITIONS *positions = params->positions;
@@ -195,7 +194,7 @@ enum action_state_t select_target(struct action_params_t *params, void *data,
case SDLK_f:
update_selected_target(surfaces, positions, NULL);
- (*cb)(surfaces, positions, params->src, &target, data);
+ (*action->f)(surfaces, positions, params->src, &target, action->data);
return ACTION_PERFORMED;
default:
@@ -237,7 +236,7 @@ enum action_state_t dig_entry(const struct entry_t *entries, int cnt_entries, st
case SDLK_RETURN:
target = &entries[selection];
if (!target->children_cnt) {
- enum action_state_t state = select_target(params, target->action.data, target->action.f);
+ enum action_state_t state = select_target(params, &target->action);
if (state == ACTION_PERFORMED)
return ACTION_PERFORMED;