Project

General

Profile

Actions

Bug #1618

open

Add-to-city always adds specialists

Added by Marko Lindqvist about 1 year ago. Updated about 3 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Server
Target version:
Start date:
07/21/2025
Due date:
% Done:

0%

Estimated time:

Description

Even when the unit has no "specialist" defined, add-to-city creates default specialists, not field workers.


Files

1618.patch (1.13 KB) 1618.patch good for S3_2 & S3_3 Dean Brown, 07/21/2026 02:59 AM
1618_Main.patch (2.07 KB) 1618_Main.patch Dean Brown, 08/30/2026 05:11 AM
Actions #1

Updated by Alexandr Ignatiev about 1 year ago

Is it a bug at all? Possibly we don't want our carefully placed workers rearranged when we add one more citizen. Here we know where the newly added citizen is. This is the behavior that existed for ages. Maybe though we could respect the city setting "new citizens will be...".

Actions #2

Updated by Marko Lindqvist about 1 year ago

Alexandr Ignatiev wrote in #note-1:

This is the behavior that existed for ages.

Oh. I thought it was new with your recent changes. Guess I haven't been using add-to-city too much previously (now been testing foodbox behavior when city grows by different means)

Actions #3

Updated by Dean Brown about 1 month ago

  • File 1618_Main.patch added
  • File 1618.patch added

See also #2080

Could call this a feature request rather than a bug. That city setting is not used when a city grows normally, nor when it gets migrated to - in those cases auto_arrange_workers() gets called. I think that's the best way to go. The current code usually leaves the city with a food deficit, and if the user doesn't click on the city and re-assign the new citizens the city will lose pop, possibly on the next turn.

Actions #4

Updated by Dean Brown about 1 month ago

  • File deleted (1618.patch)
Actions #5

Updated by Dean Brown about 1 month ago

Could target this to 3.2.6

Actions #6

Updated by Marko Lindqvist 25 days ago

  • Assignee deleted (Alexandr Ignatiev)
Actions #7

Updated by Marko Lindqvist 2 days ago

The patch seems wrong for main branch. When the unit does have "specialist" defined, it should be respected (what otherwise is the point of that feature?)

Actions #8

Updated by Dean Brown about 6 hours ago

  • File deleted (1618_Main.patch)
Actions #9

Updated by Dean Brown about 5 hours ago

  • File 1618_Main.patch added

Yeah that Main patch was bad - not understanding the new superspecialist feature. I'm still a bit unclear about the new

struct specialist spec_type; / affects only founding and adding to cities */

in struct unit_type. It looks to me like it is only used for superspecialists, so I think it can be ignored if is_super_specialist(act_utype->spec_type) returns FALSE. Maybe I'm wrong?

Actions #10

Updated by Dean Brown about 5 hours ago

  • File deleted (1618_Main.patch)
Actions #11

Updated by Dean Brown about 5 hours ago

Corrected a mistake.

Actions #12

Updated by Marko Lindqvist about 5 hours ago

  • Category set to Server
  • Target version set to 3.3.0
Actions #13

Updated by Marko Lindqvist about 5 hours ago

Dean Brown wrote in #note-9:

Yeah that Main patch was bad - not understanding the new superspecialist feature. I'm still a bit unclear about the new

struct specialist spec_type; / affects only founding and adding to cities */

in struct unit_type. It looks to me like it is only used for superspecialists, so I think it can be ignored if is_super_specialist(act_utype->spec_type) returns FALSE. Maybe I'm wrong?

As far as I know, nothing prevents one from setting regular specialists as unit spec_type, even though the feature was originally meant for superspecialists. We should do the right thing also when spec_type is set but not superspecialist.

Actions #14

Updated by Dean Brown about 4 hours ago

Looks to me like the spec_type gets defaulted to DEFAULT_SPECIALIST in load_ruleset_units(), and that code won't allow setting it to NULL. How would you un-set the unit spec_type? Is it possible to set it to none? I want to be able to have "add to city" not always add specialists. Maybe load_ruleset_units() should allow setting spec_type to NULL if there's no "specialist" entry for a unit, then the code in city_add_unit() could test for that.

Actions #15

Updated by Marko Lindqvist about 4 hours ago

Dean Brown wrote in #note-14:

Looks to me like the spec_type gets defaulted to DEFAULT_SPECIALIST in load_ruleset_units(), and that code won't allow setting it to NULL. How would you un-set the unit spec_type? Is it possible to set it to none? I want to be able to have "add to city" not always add specialists. Maybe load_ruleset_units() should allow setting spec_type to NULL if there's no "specialist" entry for a unit, then the code in city_add_unit() could test for that.

I didn't know ruleset_load() sets it even if it's not set in the ruleset. Can you open a new (future) ticket about those changes needed to make regular specialist behave correctly? I guess this one should go forward as is for now.

Actions #16

Updated by Dean Brown about 3 hours ago

Created #2187

Actions

Also available in: Atom PDF