Project

General

Profile

Actions

Feature #1541

open

Add specialist subtarget kind

Added by Alexandr Ignatiev 22 days ago. Updated about 9 hours ago.

Status:
In Progress
Priority:
Normal
Category:
General
Target version:
Start date:
06/27/2025
Due date:
% Done:

0%

Estimated time:

Description

Add ASTK_SPECIALIST value and insert it into some switches.

This ticket is prerequisite for #1478 but may also be used later for turning citizens management into actions.

Side note - currently a client can theoretically toggle any pair of specialists, as an action with single specialist subtarget each specialist toggles to a fixed another one, but an opportunity to do other has been never requested.


Files

3_4-specialist_subtarget_kind.patch (24.3 KB) 3_4-specialist_subtarget_kind.patch Alexandr Ignatiev, 06/27/2025 12:44 AM
3_4-specialist_subtarget_kind1.patch (24.3 KB) 3_4-specialist_subtarget_kind1.patch Alexandr Ignatiev, 06/29/2025 11:31 PM
3_4-specialist_subtarget_kind2.patch (24.3 KB) 3_4-specialist_subtarget_kind2.patch Alexandr Ignatiev, 07/10/2025 09:26 PM

Related issues 4 (3 open1 closed)

Blocks Feature #1478: Player controlled superspecialist additionNew05/30/2025

Actions
Blocks Feature #1552: Add "Settle Specialist" player actionNew07/01/2025

Actions
Blocked by Feature #1535: unithand.c: Improve coding styleClosedMarko Lindqvist06/22/2025

Actions
Blocks Feature #1488: Make GTK and Qt clients menu items more similarNew06/05/2025

Actions
Actions #1

Updated by Alexandr Ignatiev 22 days ago

  • Blocks Feature #1478: Player controlled superspecialist addition added
Actions #2

Updated by Alexandr Ignatiev 22 days ago

A patch currently tested only in that gtk4 client compiles

Actions #3

Updated by Alexandr Ignatiev 20 days ago

Oops, looking better at how actions are called, we can't query specific subtarget in an action enabler. Thus, to realize joining city as superspecialist, I will have to accomplish also plan A - make specialist a unit type field. Thus, superspecialist as a selectible subtarget remains for a player's action.

Actions #4

Updated by Marko Lindqvist 20 days ago

../../src/client/gui-sdl2/action_dialog.c: In function ‘simple_action_callback’:
../../src/client/gui-sdl2/action_dialog.c:814:10: error: this statement may fall through [-Werror=implicit-fallthrough=]
814 | if (nullptr == specialist_by_number(sub_target)) { | ^
../../src/client/gui-sdl2/action_dialog.c:818:5: note: here
818 | case ASTK_NONE: | ^~~~

Likely same for sdl3-client.

Actions #6

Updated by Alexandr Ignatiev 18 days ago

  • Blocks Feature #1552: Add "Settle Specialist" player action added
Actions #7

Updated by Marko Lindqvist 14 days ago

This is in conflict with #1535, but I'm not yet sure which one should go in first, and which one needs to be rebased.

Actions #8

Updated by Marko Lindqvist 14 days ago

Marko Lindqvist wrote in #note-7:

This is in conflict with #1535, but I'm not yet sure which one should go in first, and which one needs to be rebased.

I think #1535 should go in first, as it has already been some time in my work stack and is ready to go in soon, whereas this ticket will anyway be subjected to autogame testing round first.

Actions #9

Updated by Marko Lindqvist 14 days ago

  • Blocked by Feature #1535: unithand.c: Improve coding style added
Actions #10

Updated by Marko Lindqvist 12 days ago

Will you rebase this.

Actions #11

Updated by Alexandr Ignatiev 12 days ago

Marko Lindqvist wrote in #note-10:

Will you rebase this.

Probably yes, I am slowly approaching to patches that make use of it to shape it better and get it tested.

Actions #13

Updated by Marko Lindqvist 8 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #14

Updated by Marko Lindqvist 8 days ago

  • Blocks Feature #1488: Make GTK and Qt clients menu items more similar added
Actions #15

Updated by Marko Lindqvist 5 days ago

savegame3.c:

'if (!loading->specialist.order[order_sub_tgt]) {'
with an untrusted order_sub_tgt value from a savegame might access memory outside the loading->specialist.order array.

Actions #16

Updated by Marko Lindqvist 5 days ago

  • Status changed from In Review to In Progress
  • Assignee changed from Marko Lindqvist to Alexandr Ignatiev
Actions #17

Updated by Alexandr Ignatiev about 9 hours ago

currently out for a while, probably won't fix that in about a month

Actions

Also available in: Atom PDF