BUG+FIX: Claim territory of city adjacent tiles

kujezub

Chieftain
Joined
Mar 21, 2018
Messages
5
Hi all, I found a bug with the claim territory mechanic. Please take a look at the screenshot. I couldn't claim territory for the copper. I think this is caused by my city being directly adjacent to it.



The problem is in CvUnit::canClaimTerritory where it reads:
Code:
/* plots adjacent to cities always belong to those cities' owners */
if (pPlot->getAdjacentCity(getOwnerINLINE()) != NULL)
It should instead be:
Code:
if (pPlot->getAdjacentCity(pPlot->getOwnerINLINE()) != NULL)

I guess it should not have allowed me to claim the tiles directly adjacent to the upper left city either. This fixes that as well. Or maybe it should be an option for City Starts with 1 Tile?

Thanks for this great mod. It made me play CIV4 again after all these years :)
 
Are you using the Minimum City Border Option?
 
No, I'm using City Starts with 1 Tile. I attached a save file from slightly earlier in the game.
 

Attachments

  • repro-city-adjacent-tiles.zip
    929.1 KB · Views: 171
I found that even after claiming the territory, building a mine, road and having the city work on it, it would still not provide copper (says user has 0). I only got it after spamming a lot of culture in the city to claim the tile.

Is the idea behind fixed borders not that you could occupy a tile and steal it's resources?
 
I found that even after claiming the territory, building a mine, road and having the city work on it, it would still not provide copper (says user has 0). I only got it after spamming a lot of culture in the city to claim the tile.

Is the idea behind fixed borders not that you could occupy a tile and steal it's resources?
Did you build Mining Camp in the city that controls the copper mine? If not you have to do that. Then the building Copper Mine will show up in your city build gueue. Build it too. Then you will have the building Copper Smelter show up Build It. This gives copper ingots. From now having ingots you must build the Coppersmith building to get Copper Wares. Now you can build Copper Weapons!
 
I found that even after claiming the territory, building a mine, road and having the city work on it, it would still not provide copper (says user has 0). I only got it after spamming a lot of culture in the city to claim the tile.

Is the idea behind fixed borders not that you could occupy a tile and steal it's resources?
Do you have the tech Copper Working? That is when it will show up in the city because that is when it can be traded.

The map bonus is "Copper Ore". Having a mine or stone workshop on the plot and a route to the city should be showing it in the city but only once you have the tech Copper Working. It is made visible at Scavenging because it is one of those resources you need to know about to place your cities advantageously.

In my opinion it would have been wonderful if we could have displayed a bonus "metal source" at scavenging wherever there was copper, iron, tin, gold and silver (plus maybe some others) and only have it turn it into the correct bonus when it is usable.
 
Iron is also found in metallic form. Mostly from meteors but, as I found when working in the outback, lightning can form iron too. Some parts of Australia are basically rust:lol:
 
I was taking another look at the save game today. Yes, the city has a mining camp and copper working is researched. But copper is not listed in the cities resources, so I can't build a copper mine. But it worked after a few more turns, not sure if anything in particular triggered it.

I couldn't reproduce it at all playing from further back and the supply chain worked immediately. Maybe that save just got messed up when I tried to fix the original issue.

Anyway, all is working now. Thanks everyone.
 
Top Bottom