Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
Fix crash bug with cultural tech conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Idhrendur committed Apr 27, 2013
1 parent 240ceb3 commit 31aac19
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
3 changes: 2 additions & 1 deletion Data Files/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,5 @@ Revision Log Message
366
367 Merge minor into main
368 Merge bugfixes into main
369 Updates and fixes from merge
369 Updates and fixes from merge
370 Fix crash bug with cultural tech conversion
63 changes: 32 additions & 31 deletions Source/EU3World/EU3World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,112 +929,113 @@ void EU3World::convertTech(const CK2World& srcWorld)
}

// determine which decision category to use
CK2Title* srcCountry = (*countryItr)->getSrcCountry();
string category;
if (CK2Religion::getReligion((*countryItr)->getReligion())->getGroup() == "muslim")
if (srcCountry->getHolder()->getReligion()->getGroup() == "muslim")
{
category = "muslim";
}
else if (CK2Religion::getReligion((*countryItr)->getReligion())->getGroup() == "pagan_group")
else if (srcCountry->getHolder()->getReligion()->getGroup() == "pagan_group")
{
category = "other";
}
else if (CK2Religion::getReligion((*countryItr)->getReligion())->getGroup() == "zoroastrian_group")
else if (srcCountry->getHolder()->getReligion()->getGroup() == "zoroastrian_group")
{
category = "greek";
}
else if (CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "miaphysite")
else if (srcCountry->getHolder()->getReligion()->getName() == "miaphysite")
{
category = "greek";
}
else if (CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "monophysite")
else if (srcCountry->getHolder()->getReligion()->getName() == "monophysite")
{
category = "greek";
}
else if (CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "monothelite")
else if (srcCountry->getHolder()->getReligion()->getName() == "monothelite")
{
category = "greek";
}
else if ((*countryItr)->getPrimaryCulture() == "greek")
else if (srcCountry->getHolder()->getCulture() == "greek")
{
category = "greek";
}
else if ((*countryItr)->getPrimaryCulture() == "georgian")
else if (srcCountry->getHolder()->getCulture() == "georgian")
{
category = "greek";
}
else if ((*countryItr)->getPrimaryCulture() == "armenian")
else if (srcCountry->getHolder()->getCulture() == "armenian")
{
category = "greek";
}
else if (
(CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "catholic") ||
(CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "cathar") ||
(CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "fraticelli") ||
(CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "waldensian") ||
(CK2Religion::getReligion((*countryItr)->getReligion())->getName() == "lollard")
(srcCountry->getHolder()->getReligion()->getName() == "catholic") ||
(srcCountry->getHolder()->getReligion()->getName() == "cathar") ||
(srcCountry->getHolder()->getReligion()->getName() == "fraticelli") ||
(srcCountry->getHolder()->getReligion()->getName() == "waldensian") ||
(srcCountry->getHolder()->getReligion()->getName() == "lollard")
)
{
if ((*countryItr)->getPrimaryCulture() == "german")
if (srcCountry->getHolder()->getCulture() == "german")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "english")
else if (srcCountry->getHolder()->getCulture() == "english")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "saxon")
else if (srcCountry->getHolder()->getCulture() == "saxon")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "dutch")
else if (srcCountry->getHolder()->getCulture() == "dutch")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "frankish")
else if (srcCountry->getHolder()->getCulture() == "frankish")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "norman")
else if (srcCountry->getHolder()->getCulture() == "norman")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "italian")
else if (srcCountry->getHolder()->getCulture() == "italian")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "occitan")
else if (srcCountry->getHolder()->getCulture() == "occitan")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "basque")
else if (srcCountry->getHolder()->getCulture() == "basque")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "castillan")
else if (srcCountry->getHolder()->getCulture() == "castillan")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "catalan")
else if (srcCountry->getHolder()->getCulture() == "catalan")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "portuguese")
else if (srcCountry->getHolder()->getCulture() == "portuguese")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "irish")
else if (srcCountry->getHolder()->getCulture() == "irish")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "scottish")
else if (srcCountry->getHolder()->getCulture() == "scottish")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "welsh")
else if (srcCountry->getHolder()->getCulture() == "welsh")
{
category = "catholic";
}
else if ((*countryItr)->getPrimaryCulture() == "breton")
else if (srcCountry->getHolder()->getCulture() == "breton")
{
category = "catholic";
}
Expand All @@ -1050,7 +1051,7 @@ void EU3World::convertTech(const CK2World& srcWorld)

//determine tech
string title = (*countryItr)->getSrcCountry()->getTitleString();
if ( ( (title == "e_golden_horde") || (title == "e_il-khanate") || (title == "e_timurids") ) && (CK2Religion::getReligion((*countryItr)->getReligion())->getGroup() != "christian") )
if ( ( (title == "e_golden_horde") || (title == "e_il-khanate") || (title == "e_timurids") ) && (srcCountry->getHolder()->getReligion()->getGroup() != "christian") )
{
(*countryItr)->setTechGroup("nomad_group");
}
Expand Down
2 changes: 1 addition & 1 deletion TestConfigurations/Mod/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ configuration =
# techGroupMethod: the method by which tech groups are determined. Options are:
# "learningRate" - use the CK2 learning rate to determine tech groups
# "culturalTech" - use the amount of tech gained in CK2, broken down by relious and culture groups, to determine tech. NOTE: do not use this option along with mods, as it relies heavily on default religions and cultures
techGroupMethod = "culturalTech"
techGroupMethod = "learningRate"


### Economy (base tax, manpower, and population) Options
Expand Down
2 changes: 1 addition & 1 deletion TestConfigurations/Vanilla/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ configuration =
# techGroupMethod: the method by which tech groups are determined. Options are:
# "learningRate" - use the CK2 learning rate to determine tech groups
# "culturalTech" - use the amount of tech gained in CK2, broken down by relious and culture groups, to determine tech. NOTE: do not use this option along with mods, as it relies heavily on default religions and cultures
techGroupMethod = "culturalTech"
techGroupMethod = "learningRate"


### Economy (base tax, manpower, and population) Options
Expand Down

0 comments on commit 31aac19

Please sign in to comment.