From 7d0da72d0e36c4ac648d84c57471e811b25508f9 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 9 Aug 2022 00:43:58 +0300 Subject: [PATCH 27/27] Check that cargo can actually load to transports shown at transportdlg See osdn #45331 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/transportdlg.c | 3 +-- client/gui-gtk-3.22/transportdlg.c | 3 +-- client/gui-qt/dialogs.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/gui-gtk-3.0/transportdlg.c b/client/gui-gtk-3.0/transportdlg.c index 02cb837d58..0cf5c41ecc 100644 --- a/client/gui-gtk-3.0/transportdlg.c +++ b/client/gui-gtk-3.0/transportdlg.c @@ -86,8 +86,7 @@ bool request_transport(struct unit *cargo, struct tile *ptile) struct unit *best_transport = transporter_for_unit_at(cargo, ptile); unit_list_iterate(ptile->units, ptransport) { - if (can_unit_transport(ptransport, cargo) - && get_transporter_occupancy(ptransport) < get_transporter_capacity(ptransport)) { + if (could_unit_load(cargo, ptransport)) { unit_list_append(potential_transports, ptransport); } } unit_list_iterate_end; diff --git a/client/gui-gtk-3.22/transportdlg.c b/client/gui-gtk-3.22/transportdlg.c index b5b302a893..b3a9641b27 100644 --- a/client/gui-gtk-3.22/transportdlg.c +++ b/client/gui-gtk-3.22/transportdlg.c @@ -86,8 +86,7 @@ bool request_transport(struct unit *cargo, struct tile *ptile) struct unit *best_transport = transporter_for_unit_at(cargo, ptile); unit_list_iterate(ptile->units, ptransport) { - if (can_unit_transport(ptransport, cargo) - && get_transporter_occupancy(ptransport) < get_transporter_capacity(ptransport)) { + if (could_unit_load(cargo, ptransport)) { unit_list_append(potential_transports, ptransport); } } unit_list_iterate_end; diff --git a/client/gui-qt/dialogs.cpp b/client/gui-qt/dialogs.cpp index 4b07994bbb..b0a5cbf3fb 100644 --- a/client/gui-qt/dialogs.cpp +++ b/client/gui-qt/dialogs.cpp @@ -3998,8 +3998,7 @@ bool qtg_request_transport(struct unit *pcargo, struct tile *ptile) #endif unit_list_iterate(ptile->units, ptransport) { - if (can_unit_transport(ptransport, pcargo) - && get_transporter_occupancy(ptransport) < get_transporter_capacity(ptransport)) { + if (could_unit_load(pcargo, ptransport)) { unit_list_append(potential_transports, ptransport); } } unit_list_iterate_end; -- 2.35.1