Finding a needle in a haystack

Chronis

Warlord
Joined
Feb 3, 2011
Messages
102
So I want to cap the happiness bonus from Monarchy to a maximum of 5 happiness per city.

Fortunately for me there is already a mod out there which has implemented this exact feature.
http://forums.civfanatics.com/showthread.php?t=322407

Unfortunately, it a massive mod that changes all sorts of stuff and I have no idea where the code I need might be hiding.

If I can find the code it should not be hard to copy it.
Any suggestions from those wiser in modding then myself on how to locate this
particular needle in this haystack.
 
I would start by looking in the CvInfos.cpp/h files at the CvCivicInfo class for variables/methods that are related to the maximum value. You should be able to narrow it down by looking in the XML/GameInfo/CIV4CivicInfos.xml file for a tag that sets this value. If you search for the tag name in
PHP:
bool CvCivicInfo::read(CvXMLLoadUtility* pXML)
it should give you a starting point into this section of the code.

I would also suspect that
PHP:
void CvPlayer::processCivics(CivicTypes eCivic, int iChange)
will reference one of the methods you identify in CvCivicInfo, as this method is what is called when you change civics. The CvPlayer class is also likely to have a member variable and some methods around this, one of which is probably called from the processCivics() method.
 
Back
Top Bottom