Skip to content

Border Recalculation when a city is destroyed/captured #854

@stavrosfa

Description

@stavrosfa

When a city (city A) is captured (and currently destroyed by default), a neighboring city (city B) that has a connecting tile, meaning a tile that is there because of Law 7 or 8

foreach (Tile t in player.tileKnowledge.knownTiles.Where(t => t.owningCity == null && t.GetEdgeNeighbors().Any(e => e.owningCity != null)).ToList()) {

remains in the city that can't actually justify owning it now that city A is gone.

We do calcuate the tiles after capture here

UpdateTileOwners();

but we need to recalculate the affected tiles, and remove ownership of tiles that we can't justify.

To be cleared, the tile is not justified because 1. the owning city hasn't expanded, 2. its existance is solely because of border laws.

Also, when removing tile ownership from CityA, here

foreach (Tile tile in city.GetTilesWithinBorders()) {

I am not sure that's enough and we don't end up with leftover tile ownership that we can't just see, I haven't tested for that, it's merely a thought.

But in any case, we should go through with the fix for the tiles with the destroyed city too, because the dangling tile could have been in the destroyed city's ownership just as well that GetTilesWithinBorders() wouldn't be able to retrieve.

Here is an screenshot to better visualize the scenario

Image

After another civ captured my Old City (expanded once), the tile that belongs to Utrecht marked with X should have been removed but remains in Utrecht's ownership.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions