extremely minor perfs

This commit is contained in:
yairm210 2024-09-08 17:26:22 +03:00
parent 8d8134f6b5
commit 558b6c03e3
2 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,7 @@ object TargetHelper {
val tilesInAttackRange = val tilesInAttackRange =
if (unit.baseUnit.isMelee()) reachableTile.neighbors if (unit.baseUnit.isMelee()) reachableTile.neighbors
else if (unit.hasUnique(UniqueType.IndirectFire, checkCivInfoUniques = true) || unit.baseUnit.movesLikeAirUnits) else if (unit.baseUnit.movesLikeAirUnits || unit.hasUnique(UniqueType.IndirectFire, checkCivInfoUniques = true))
reachableTile.getTilesInDistance(rangeOfAttack) reachableTile.getTilesInDistance(rangeOfAttack)
else reachableTile.tileMap.getViewableTiles(reachableTile.position, rangeOfAttack, true).asSequence() else reachableTile.tileMap.getViewableTiles(reachableTile.position, rangeOfAttack, true).asSequence()

View File

@ -320,8 +320,9 @@ class CityReligionManager : IsPartOfGameInfoSerialization {
} }
// Founder beliefs of this religion // Founder beliefs of this religion
if (getMajorityReligion() != null) { val majorityReligion = getMajorityReligion()
for (unique in getMajorityReligion()!!.getFounder().getMatchingUniques(UniqueType.NaturalReligionSpreadStrength)) if (majorityReligion != null) {
for (unique in majorityReligion.getFounder().getMatchingUniques(UniqueType.NaturalReligionSpreadStrength))
if (pressuredCity.matchesFilter(unique.params[1])) if (pressuredCity.matchesFilter(unique.params[1]))
pressure *= unique.params[0].toPercent() pressure *= unique.params[0].toPercent()
} }