50 if (arg == GTK_RESPONSE_YES) {
53 g_object_get_data(G_OBJECT(dlg),
57 int tp_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
59 struct tile *ptile = g_object_get_data(G_OBJECT(dlg),
"tile");
67 if (ptransport != NULL) {
75 gtk_widget_destroy(dlg);
85 struct unit_list *potential_transports = unit_list_new();
90 unit_list_append(potential_transports, ptransport);
94 tcount = unit_list_size(potential_transports);
98 unit_list_destroy(potential_transports);
101 }
else if (tcount == 1) {
103 fc_assert(unit_list_get(potential_transports, 0) == best_transport);
106 unit_list_destroy(potential_transports);
111 return select_tgt_unit(cargo, ptile, potential_transports, best_transport,
112 _(
"Transport selection"),
113 _(
"Looking for transport:"),
114 _(
"Transports available:"),
void request_unit_load(struct unit *pcargo, struct unit *ptrans, struct tile *ptile)
struct unit * game_unit_by_number(int id)
static void transport_response_callback(GtkWidget *dlg, gint arg)
bool request_transport(struct unit *cargo, struct tile *ptile)
bool select_tgt_unit(struct unit *actor, struct tile *ptile, struct unit_list *potential_tgt_units, struct unit *suggested_tgt_unit, const gchar *dlg_title, const gchar *actor_label, const gchar *tgt_label, const gchar *do_label, GCallback do_callback)
#define fc_assert(condition)
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end