3.11.0-patch1

Solved some errors that occured as a result of the recent changes assuming the specialists exist, which is not true in revamp mods
This commit is contained in:
Yair Morgenstern
2020-10-04 15:18:26 +03:00
parent 3e98e0c00f
commit be2dd5c068
3 changed files with 5 additions and 4 deletions

View File

@ -298,7 +298,7 @@ open class TileInfo {
/** Without regards to what civinfo it is, a lot of the checks are ust for the improvement on the tile.
* Doubles as a check for the map editor.
*/
fun canImprovementBeBuiltHere(improvement: TileImprovement, resourceIsVisible:Boolean = true): Boolean {
fun canImprovementBeBuiltHere(improvement: TileImprovement, resourceIsVisible:Boolean = resource!=null): Boolean {
val topTerrain = getLastTerrain()
return when {

View File

@ -152,7 +152,8 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
specialistIcons.row().size(20f).pad(5f)
for (stat in building.specialistSlots!!.toHashMap()) {
if (stat.value == 0f) continue
val specialist = cityInfo.getRuleset().specialists[cityInfo.population.specialistNameByStat(stat.key)]!!
val specialist = cityInfo.getRuleset().specialists[cityInfo.population.specialistNameByStat(stat.key)]
if (specialist == null) continue // probably a mod that doesn't have the specialist defined yet
for (i in 0 until stat.value.toInt())
specialistIcons.add(ImageGetter.getSpecialistIcon(specialist.colorObject)).size(20f)
}