Added an extra barbarian check to nukes (#11454)

This commit is contained in:
Oskar Niesen 2024-04-11 15:38:21 -05:00 committed by GitHub
parent 58243152c9
commit 9efbbae6de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,7 @@ object Nuke {
if (defenderCiv == null) return if (defenderCiv == null) return
// Allow nuking yourself! (Civ5 source: CvUnit::isNukeVictim) // Allow nuking yourself! (Civ5 source: CvUnit::isNukeVictim)
if (defenderCiv == attackerCiv || defenderCiv.isDefeated()) return if (defenderCiv == attackerCiv || defenderCiv.isDefeated()) return
if (defenderCiv.isBarbarian()) return
// Gleaned from Civ5 source - this disallows nuking unknown civs even in invisible tiles // Gleaned from Civ5 source - this disallows nuking unknown civs even in invisible tiles
// https://github.com/Gedemon/Civ5-DLL/blob/master/CvGameCoreDLL_Expansion1/CvUnit.cpp#L5056 // https://github.com/Gedemon/Civ5-DLL/blob/master/CvGameCoreDLL_Expansion1/CvUnit.cpp#L5056
// https://github.com/Gedemon/Civ5-DLL/blob/master/CvGameCoreDLL_Expansion1/CvTeam.cpp#L986 // https://github.com/Gedemon/Civ5-DLL/blob/master/CvGameCoreDLL_Expansion1/CvTeam.cpp#L986