autoattack: cargo attacks before transporters.
commit5114fb725d656822ac29959eb518516e7cc04ffb
authorsveinung <sveinung@a0f10bec-cc02-0410-94fc-a9cfff90b4cd>
Fri, 4 Nov 2016 12:10:26 +0000 (4 12:10 +0000)
committersveinung <sveinung@a0f10bec-cc02-0410-94fc-a9cfff90b4cd>
Fri, 4 Nov 2016 12:10:26 +0000 (4 12:10 +0000)
treec68b5cfcb309143c45b084f36970e07a362f8cf6
parent76a57b5dffe5183b61f730a2aa7d3d4a5d615392
autoattack: cargo attacks before transporters.

The function compare_units() tried to make a cargo unit auto attack before
its transporter by sorting the autoattacker list. Fix the function that
compares two units during the sorting so it does:
 * put cargo units *before* transporting units.
 * check the cargo status of *both* units being compared.
 * consider recursive transports.

See bug #25259

git-svn-id: svn://svn.gna.org/svn/freeciv/trunk@34384 a0f10bec-cc02-0410-94fc-a9cfff90b4cd
server/unittools.c