bugFreeciv - Bugs: bug #21898, City destruction and...

Show feedback again

bug #21898: City destruction and "AlwaysOnCityCenter" extras

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Mon Apr 7 20:23:31 2014  
Category: generalSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Emmet Hikory <persia>Open/Closed: Closed
Release: Operating System: None
Planned Release: 2.5.0, 2.6.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Fri May 23 05:53:30 2014, SVN revision 24936:

Remove unsuitable extras when city is removed

See bug #21898

(Browse SVN revision 24936)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Fri May 23 05:50:46 2014, SVN revision 24935:

Remove unsuitable roads and bases on city removal

See bug #21898

(Browse SVN revision 24935)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sat May 17 12:03:27 2014, comment #7:

Indeed, the client is not updated if there are units with vision of the site after the city is gone: my testing involved using Diplomats to preserve vision, and building Settlers to destroy the city. Disconnecting the client and reconnecting updates apprpriately, but there should probably be some vision update happening in remove_city(). I looked about a bit, but couldn't figure out the right call, so am leaving this in an unfortunate state for now (not a regression from prior behaviour, but not ideal).

(file #20752)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Tue May 13 19:16:54 2014, comment #6:

At least server side works here...

I'm not sure if client side would be updated if there would be unit with vision of the site after the city has gone. In my test I lost the vision completely with the city, and thus I "found out" about loss of road only when I took new unit to re-examine the area.

Marko Lindqvist <cazfi>
Project Administrator
Sun May 11 05:47:13 2014, comment #5:

Unfortunately, the associated theoretical S2_5 patch didn't actually work in practice (at least for civ1 ruleset, adding a negated requirement for "Terrain", "Mountains", "Local" to Road), either in the editor or on disband from Settler building. Returning to the trunk patch again, with the same test condition (excepting replacing negated with present semantics, and moving the reqs from the road to the extra), it also fails the test.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sat May 10 00:37:45 2014, comment #4:

> would the attached patch accomplish that

That's exactly the patch I were about to write. ;-)

S2_5 patch will need to handle both bases and roads (separately).

Marko Lindqvist <cazfi>
Project Administrator
Tue Apr 8 23:18:08 2014, comment #3:

As an example, do you mean that if a ruleset prohibits Railroad on Mountains, Railroad is AlwaysOnCityCenter, and cities are allowed on Mountains, the Railroad is removed when the city is destroyed if the city is on Mountains, but not if it is on Plains (which otherwise permit Railroad in the ruleset)?

If so, I agree entirely. I'm still catching up on the extras code, but would the attached patch accomplish that, or should it also consider whether the extra was AutoOnCityCenter in the first place?

(file #20500)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Tue Apr 8 21:54:35 2014, comment #2:

> build a road over a river before one has Bridge Building is a
> bit of a rules hack, and probably ought be disallowed.

In a way yes, but
- It has always been allowed (civ/2, freeciv < 2.5)
- Handling generic case of "player wouldn't be able to build this road now" would be very difficult, and what would be the "correct" rule?
- While the last owner of the city is not currently able to build bridges, (s)he may have been earlier (tech loss), or maybe some previous owner of the city (maybe the founder) was.
- Existing bridges on other tiles are not removed when tech loss occurs or terrain gets conquered by someone who does not know Bridge Building

So I would go by freeciv < 2.5 model that no player specific requirement would be considered, but only the tile's ability to have road/extra would affect if road/extra gets removed.

Marko Lindqvist <cazfi>
Project Administrator
Mon Apr 7 22:01:25 2014, comment #1:

If anything is removed, only infrastructure that could not exist on that tile if it were not a city (so can't exist once the city is no longer active) should be removed. This matches ancient behaviour. In terms of narrative, it makes sense that the old roads in the city and the old train tracks are still there, and if they are used, are probably being maintained as well as any other roads/tracks/etc. On the other hand, playing with migration, and founding an unhappy city (to be migrated away) to build a road over a river before one has Bridge Building is a bit of a rules hack, and probably ought be disallowed.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Mon Apr 7 20:23:31 2014, original submission:

Before "AlwaysOnCityCenter" roads/bases/extras were added, patch #3154 removed at that point obsolete code to remove unsuitable roads from the city center tile when city got destroyed.
Do roads/bases/extras existing in tile only because it's city center get removed when city gets removed? Needs confirming.

Marko Lindqvist <cazfi>
Project Administrator


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #20752:  remove-unsuitable-roads-bases.patch added by persia (1kB - application/octet-stream)
file #20500:  remove-unsuitable-extras.patch added by persia (1000B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by persia (Posted a comment)
  • -unavailable- added by cazfi (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri May 23 05:55:19 2014persiaStatusReady For Test=>Fixed
    Sat May 17 12:03:27 2014persiaAttached File-=>Added remove-unsuitable-roads-bases.patch, #20752
      StatusIn Progress=>Ready For Test
    Sun May 11 05:47:13 2014persiaStatusNone=>In Progress
    Sat May 10 00:44:06 2014persiaAssigned toNone=>persia
    Sat May 10 00:37:45 2014cazfiCategoryNone=>general
    Tue Apr 8 23:18:08 2014persiaAttached File-=>Added remove-unsuitable-extras.patch, #20500
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup