mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-06 16:28:40 +07:00
Resolved #10366 - City centers don't provide resources you don't have tech to extract
This commit is contained in:
@ -452,7 +452,16 @@ open class Tile : IsPartOfGameInfoSerialization {
|
||||
|
||||
fun providesResources(civInfo: Civilization): Boolean {
|
||||
if (!hasViewableResource(civInfo)) return false
|
||||
if (isCityCenter()) return true
|
||||
if (isCityCenter()) {
|
||||
val possibleImprovements = tileResource.getImprovements()
|
||||
if (possibleImprovements.isEmpty()) return true
|
||||
// Per Civ V, resources under city tiles require the *possibility of extraction* -
|
||||
// that is, there needs to be a tile improvement you have the tech for.
|
||||
// Does NOT take all GetImprovementBuildingProblems into account.
|
||||
return possibleImprovements.any {
|
||||
ruleset.tileImprovements[it]?.let { it.techRequired==null || civInfo.tech.isResearched(it.techRequired!!) } == true
|
||||
}
|
||||
}
|
||||
val improvement = getUnpillagedTileImprovement()
|
||||
if (improvement != null && improvement.name in tileResource.getImprovements()
|
||||
&& (improvement.techRequired == null || civInfo.tech.isResearched(improvement.techRequired!!))
|
||||
|
Reference in New Issue
Block a user