Allow barb camps to function after giving ruins effects (#11137)

* Allow barb camps to function after giving ruins effects

* Add comment
This commit is contained in:
SeventhM
2024-02-17 11:41:21 -08:00
committed by GitHub
parent 5730d1b80a
commit ec1f51dfb8

View File

@ -802,14 +802,16 @@ class MapUnit : IsPartOfGameInfoSerialization {
// addPromotion requires currentTile to be valid because it accesses ruleset through it.
// getAncientRuinBonus, if it places a new unit, does too
currentTile = tile
// The improvement may get removed if it has ruins effects or is a barbarian camp, and will still be needed if removed
val improvement = tile.improvement
if (civ.isMajorCiv()
&& tile.improvement != null
&& tile.getTileImprovement()!!.isAncientRuinsEquivalent()
&& improvement != null
&& tile.ruleset.tileImprovements[improvement]!!.isAncientRuinsEquivalent()
) {
getAncientRuinBonus(tile)
}
if (tile.improvement == Constants.barbarianEncampment && !civ.isBarbarian())
if (improvement == Constants.barbarianEncampment && !civ.isBarbarian())
clearEncampment(tile)
// Check whether any civilians without military units are there.
// Keep in mind that putInTile(), which calls this method,