From 63d189ecd8bad0e5436a71aef1f4e0c346cf3ee6 Mon Sep 17 00:00:00 2001 From: Idhrendur Date: Wed, 15 Nov 2017 20:19:59 -0800 Subject: [PATCH] Handle disappearing countries more gracefully. --- Vic2ToHoI4/Source/HOI4World/HoI4Country.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Vic2ToHoI4/Source/HOI4World/HoI4Country.cpp b/Vic2ToHoI4/Source/HOI4World/HoI4Country.cpp index 7ff56c1a2..20f683c91 100644 --- a/Vic2ToHoI4/Source/HOI4World/HoI4Country.cpp +++ b/Vic2ToHoI4/Source/HOI4World/HoI4Country.cpp @@ -1250,14 +1250,17 @@ void HoI4Country::outputNamesSet(ofstream& namesFile, const vector& name void HoI4Country::output(const set& ideologicalMinisters, const vector& divisionTemplates) const { - outputHistory(); - outputOOB(divisionTemplates); - outputCommonCountryFile(); - outputIdeas(ideologicalMinisters); - - if (nationalFocus != nullptr) + if (capitalStateNum != 0) { - nationalFocus->output("output/" + Configuration::getOutputName() + "/common/national_focus/" + srcCountry->getTag() + "_NF.txt"); + outputHistory(); + outputOOB(divisionTemplates); + outputCommonCountryFile(); + outputIdeas(ideologicalMinisters); + + if (nationalFocus != nullptr) + { + nationalFocus->output("output/" + Configuration::getOutputName() + "/common/national_focus/" + srcCountry->getTag() + "_NF.txt"); + } } }