diff -Nur -X/home/thue/freeciv-dev/no.freeciv /home/thue/freeciv-dev/freeciv/common/unit.c little_fix/common/unit.c --- /home/thue/freeciv-dev/freeciv/common/unit.c Fri Mar 17 18:47:25 2000 +++ little_fix/common/unit.c Thu Apr 6 18:50:25 2000 @@ -293,20 +293,20 @@ Specifically: only pplayer's transports count; only returns true/false; and returns true if (capacity == passengers). --dwp **************************************************************************/ -int is_enough_transporter_space (struct player *pplayer, int x, int y) +int is_enough_transporter_space(struct player *pplayer, int x, int y) { - int none_transporters=0, total_capacity=0; - - unit_list_iterate(map_get_tile(x, y)->units, punit) { - if(is_ground_units_transport(punit) - && punit->owner == pplayer->player_no) - total_capacity+=get_transporter_capacity(punit); - else if (is_ground_unit(punit)) - none_transporters++; - } + int total_capacity = 0; + + unit_list_iterate(map_get_tile(x, y)->units, punit) + if (punit->owner == pplayer->player_no) { + if (is_ground_units_transport(punit)) + total_capacity += get_transporter_capacity(punit); + else if (is_ground_unit(punit)) + total_capacity--; + } unit_list_iterate_end; - - return(total_capacity>=none_transporters ? 1 : 0); + + return(total_capacity>=0 ? 1 : 0); }