From 26851ae1f0e9995be832803caf94e489b45e278b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 9 Aug 2022 00:29:20 +0300 Subject: [PATCH 41/41] Check that cargo can actually load to transports shown at transportdlg See osdn #45331 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/transportdlg.c | 3 +-- client/gui-gtk-4.0/transportdlg.c | 3 +-- client/gui-qt/dialogs.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/gui-gtk-3.22/transportdlg.c b/client/gui-gtk-3.22/transportdlg.c index dcb9ed6c23..dfefd396e7 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-gtk-4.0/transportdlg.c b/client/gui-gtk-4.0/transportdlg.c index 62c8bb59ef..ec81a32449 100644 --- a/client/gui-gtk-4.0/transportdlg.c +++ b/client/gui-gtk-4.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-qt/dialogs.cpp b/client/gui-qt/dialogs.cpp index f3dad03e0b..9200ca724c 100644 --- a/client/gui-qt/dialogs.cpp +++ b/client/gui-qt/dialogs.cpp @@ -4852,8 +4852,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