mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 17:28:57 +07:00
Bugfixes (#3007)
* Fixed "Can move immediately once bought" unique * Spectators no longer can adopt policies Close button is no longer disabled when player has free policy but has no adoptable policies FreePolicies are being spent properly in scenario editor mode * redundant
This commit is contained in:
@ -109,9 +109,9 @@ class PolicyManager {
|
|||||||
|
|
||||||
fun adopt(policy: Policy, branchCompletion: Boolean = false) {
|
fun adopt(policy: Policy, branchCompletion: Boolean = false) {
|
||||||
|
|
||||||
if (!branchCompletion && !civInfo.gameInfo.gameParameters.godMode) {
|
if (!branchCompletion) {
|
||||||
if (freePolicies > 0) freePolicies--
|
if (freePolicies > 0) freePolicies--
|
||||||
else {
|
else if (!civInfo.gameInfo.gameParameters.godMode) {
|
||||||
val cultureNeededForNextPolicy = getCultureNeededForNextPolicy()
|
val cultureNeededForNextPolicy = getCultureNeededForNextPolicy()
|
||||||
if (cultureNeededForNextPolicy > storedCulture)
|
if (cultureNeededForNextPolicy > storedCulture)
|
||||||
throw Exception("How is this possible??????")
|
throw Exception("How is this possible??????")
|
||||||
|
@ -154,7 +154,7 @@ class BaseUnit : INamed, IConstruction {
|
|||||||
if (unit == null) return false // couldn't place the unit, so there's actually no unit =(
|
if (unit == null) return false // couldn't place the unit, so there's actually no unit =(
|
||||||
|
|
||||||
//movement penalty
|
//movement penalty
|
||||||
if (wasBought && !unit.hasUnique("Can move directly once bought") && !civInfo.gameInfo.gameParameters.godMode)
|
if (wasBought && !unit.hasUnique("Can move immediately once bought") && !civInfo.gameInfo.gameParameters.godMode)
|
||||||
unit.currentMovement = 0f
|
unit.currentMovement = 0f
|
||||||
|
|
||||||
if (this.unitType.isCivilian()) return true // tiny optimization makes save files a few bytes smaller
|
if (this.unitType.isCivilian()) return true // tiny optimization makes save files a few bytes smaller
|
||||||
|
@ -28,7 +28,7 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
|||||||
setDefaultCloseAction()
|
setDefaultCloseAction()
|
||||||
if (policies.freePolicies > 0) {
|
if (policies.freePolicies > 0) {
|
||||||
rightSideButton.setText("Adopt free policy".tr())
|
rightSideButton.setText("Adopt free policy".tr())
|
||||||
closeButton.disable()
|
if (policies.canAdoptPolicy()) closeButton.disable()
|
||||||
}
|
}
|
||||||
else onBackButtonClicked { UncivGame.Current.setWorldScreen() }
|
else onBackButtonClicked { UncivGame.Current.setWorldScreen() }
|
||||||
|
|
||||||
@ -82,6 +82,7 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
|||||||
|
|
||||||
private fun pickPolicy(policy: Policy) {
|
private fun pickPolicy(policy: Policy) {
|
||||||
if (!worldScreen.isPlayersTurn
|
if (!worldScreen.isPlayersTurn
|
||||||
|
|| worldScreen.viewingCiv.isSpectator() // viewingCiv var points to selectedCiv in case of spectator
|
||||||
|| viewingCiv.isDefeated()
|
|| viewingCiv.isDefeated()
|
||||||
|| viewingCiv.policies.isAdopted(policy.name)
|
|| viewingCiv.policies.isAdopted(policy.name)
|
||||||
|| policy.name.endsWith("Complete")
|
|| policy.name.endsWith("Complete")
|
||||||
|
Reference in New Issue
Block a user