Resolved #1250 - Resources requiring a specific tech to build the improvement, are no longer provided before researching that tech (by cities etc)

This commit is contained in:
Yair Morgenstern 2019-10-28 21:09:18 +02:00
parent 6a46af4f88
commit 827af89498

View File

@ -126,6 +126,13 @@ class CityInfo {
for (tileInfo in getTiles().filter { it.resource != null }) {
val resource = tileInfo.getTileResource()
if (resource.revealedBy!=null && !civInfo.tech.isResearched(resource.revealedBy!!)) continue
// Even if the improvement exists (we conquered an enemy city or somesuch) or we have a city on it, we won't get the resource until the correct tech is researched
if (resource.improvement!=null){
val improvement = GameBasics.TileImprovements[resource.improvement!!]!!
if(improvement.techRequired!=null && !civInfo.tech.isResearched(improvement.techRequired!!)) continue
}
if (resource.improvement == tileInfo.improvement || tileInfo.isCityCenter()
// Per https://gaming.stackexchange.com/questions/53155/do-manufactories-and-customs-houses-sacrifice-the-strategic-or-luxury-resources
|| (resource.resourceType==ResourceType.Strategic && tileInfo.containsGreatImprovement())){