Do not allow to buy what can not be built (#2007)

This commit is contained in:
JackRainy 2020-02-24 08:14:21 +02:00 committed by GitHub
parent 3b4bce780a
commit 55a8211be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -277,6 +277,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
val button = TextButton("", CameraStageBaseScreen.skin)
if (construction == null || !construction.canBePurchased()
|| !construction.isBuildable(cityConstructions)
|| !UncivGame.Current.worldScreen.isPlayersTurn
|| city.isPuppet || city.isInResistance()) {
button.setText("Buy".tr())