mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
Fix spies being gained in non espionage games (#7661)
* Handfull of comment questions, small refactorings * Code changes * Reworded a unique, removed a file * Added spy names for all nations, minor consistency change * Removed debug output * Added an empty constructor so gdx can reconstruct it * No spies gained when espionage is disabled * Added missing function
This commit is contained in:
@ -212,6 +212,10 @@ class GameInfo : IsPartOfGameInfoSerialization, HasGameInfoSerializationVersion
|
||||
return !religionDisabledByRuleset && gameParameters.religionEnabled
|
||||
}
|
||||
|
||||
fun isEspionageEnabled(): Boolean {
|
||||
return gameParameters.espionageEnabled
|
||||
}
|
||||
|
||||
private fun getEquivalentTurn(): Int {
|
||||
val totalTurns = speed.numTotalTurns()
|
||||
val startPercent = ruleSet.eras[gameParameters.startingEra]!!.startPercent
|
||||
@ -540,6 +544,7 @@ class GameInfo : IsPartOfGameInfoSerialization, HasGameInfoSerializationVersion
|
||||
//endregion
|
||||
|
||||
fun asPreview() = GameInfoPreview(this)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -479,6 +479,7 @@ object UniqueTriggerActivation {
|
||||
|
||||
OneTimeGlobalSpiesWhenEnteringEra -> {
|
||||
if (!civInfo.isMajorCiv()) return false
|
||||
if (!civInfo.gameInfo.isEspionageEnabled()) return false
|
||||
val currentEra = civInfo.getEra().name
|
||||
for (otherCiv in civInfo.gameInfo.getAliveMajorCivs()) {
|
||||
if (currentEra !in otherCiv.espionageManager.erasSpyEarnedFor) {
|
||||
|
Reference in New Issue
Block a user