Assert failure from an autogame indicates that this might sometimes unload passenger even when it cannot exist at that location.
- Check that passenger can exist at tile before unloading it
The unloaded unit might need changing its activity from sentry to idle. I'm investigating an autogame with a unit having ACTIVITY_SENTRY when it shouldn't, and this patch is the prime suspect.
Reply To cazfi
I'm investigating an autogame with a unit having ACTIVITY_SENTRY when it shouldn't, and this patch is the prime suspect.
Still investigating the case, but have eliminated this patch as a possible explanation.
That means that this patch has successfully passed heavy autogame testing already.
Related to discussion in #43630.
Currently AI's amphibious goto is considered finished when the passenger reaches the target tile. Under some rules that can happen even so that the transport has gone all the way to the target tile (River boats etc), and the passenger is still loaded to that transport.
Unload the unit in such a case in the end of the goto.