I don't understand your point about "sticking" on desert tiles. Yes, the suspensor unit's move rate decreases when it goes over land. But why would it "stick" on desert tiles?
Sorry, casual language use.
Imagine the following: there are three moderate size islands in a row, A B C, each with significant desert gaps between them. Imagine that the civ on island A is invading the civ on island C, that both A and C have open borders with the civ on B.
Imagine also that island C has some very jagged borders, with lots of jagged rock outcrops, and fingers of desert (like fiords) going in towards its cities, and imagine that its cities are several tiles from the coast.
If A has a stack of suspensors, their pathfinding will guide them around island B, staying on desert tiles, because they move faster that way; each desert tile only takes half a movement point. And then their pathfinding will move them up the desert fiords, leavnig the desert only when they arrive right on the doorstep of their target city.
So there are no particular issues with worrying about them being on land before they get to their target.
In contrast, a stack of carryalls will fly directly over B, potentially risking being attacked by any ground units there, and then will fly over the rock outcroppings in the most direct route to get up to the target city on C (rather than following the desert fiords), again exposing them to enemy ground units.
I guess the point I am trying to make is, the fact that some transports (carryalls) take a route that flies them over a lot of land tiles means that a simple function that unloads as soon as they are over land, or as soon as they are over land with a single enemy unit nearby, could end up dumping them on island B, or could end up dumping them on island C a long way from their target city.
[It could be even worse if island B is connected to island C by a narrow pathway somewhere else, so they are technically on the same continent).
Hence, we ideally need some knid of function that will force unload only when there is a signicant number of enemy units nearby.
Hopefully the code above from Sephi will do this.
Depending on how iOurDefense and iEnemyOffense are defined, we might want to bias this a little more towards danger.
Eg: if (
iOurDefense + X < iEnemyOffensve) bDanger = true;
for some X