non-native attack failed

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Wahazar
Elite
Posts: 344
Joined: Mon Jul 02, 2018 1:49 pm

non-native attack failed

Postby Wahazar » Tue Jul 14, 2020 11:17 am

I have ruleset with unit class, which has "AttackNonNative", "AttFromNonNative" flags (freeciv 2.6).
This unit can be transported, but sometimes attack from transport board doesn't work, there is following message in console instead:

Code: Select all

1: in request_transport() [transportdlg.c::104]: assertion 'unit_list_get(potential_transports, 0) == best_transport' failed.


What can be a reason of such behavior?
Augmented2 ruleset/modpack for freeciv2.6: viewtopic.php?f=11&t=91047

Ignatus
Elite
Posts: 352
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: non-native attack failed

Postby Ignatus » Wed Jul 15, 2020 7:05 am

Likely, the client tries to board the ememy instead of attacking it. This is strange, control.c code calls request_transport() only if the destination move tile has unlivable terrain. What client do you use?

User avatar
Caedo
Elite
Posts: 494
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: non-native attack failed

Postby Caedo » Wed Jul 15, 2020 10:14 am

Ignatus wrote:This is strange, control.c code calls request_transport() only if the destination move tile has unlivable terrain.

If I understand this correctly, that's precisely the case – an attack from a non-native tile against another non-native tile.

Wahazar
Elite
Posts: 344
Joined: Mon Jul 02, 2018 1:49 pm

Re: non-native attack failed

Postby Wahazar » Wed Jul 15, 2020 11:56 am

Ignatus wrote:Likely, the client tries to board the ememy instead of attacking it. This is strange, control.c code calls request_transport() only if the destination move tile has unlivable terrain. What client do you use?

Both Qt and Gtk has this effect.
Yes, attacking unit (turret) have no livelable terrain at all (it can't move by itself, only by transport), so it attack from unlivable at unlivable.
Augmented2 ruleset/modpack for freeciv2.6: viewtopic.php?f=11&t=91047

Ignatus
Elite
Posts: 352
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: non-native attack failed

Postby Ignatus » Wed Jul 15, 2020 1:44 pm

Ah yes, now I understand. Yes, it's a bug in client logic. HRM#881350

Wahazar
Elite
Posts: 344
Joined: Mon Jul 02, 2018 1:49 pm

Re: non-native attack failed

Postby Wahazar » Wed Jul 15, 2020 7:41 pm

Another issue (maybe related) is that it is not possible to use goto to attack unit on non-native tile.
Augmented2 ruleset/modpack for freeciv2.6: viewtopic.php?f=11&t=91047

Ignatus
Elite
Posts: 352
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: non-native attack failed

Postby Ignatus » Wed Jul 15, 2020 8:46 pm

Put a patch on HRM. In my test, it worked. I hope it does not break other stuff where request_transport is called :?