SpecialistYields - YIELD_FAITH

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
Has anyone looked into this or got it working?

Culture is still added separately. However, a quick look at dll code makes me think Faith should work. It's even referenced in CvCityCitizens::IsAIWantSpecialistRightNow():
Code:
if(pSpecialistInfo && pSpecialistInfo->getYieldChange(YIELD_FAITH) > 0)

However, the yield from faith specialist isn't working for me. The DB is correct. One possible reason it may not work in Éa is that I have 2 different specialists that both give Faith. I can't quite deconvolute dll DB code to know if that is a problem or not.
 
Has anyone looked into this or got it working?

Culture is still added separately. However, a quick look at dll code makes me think Faith should work. It's even referenced in CvCityCitizens::IsAIWantSpecialistRightNow():
Code:
if(pSpecialistInfo && pSpecialistInfo->getYieldChange(YIELD_FAITH) > 0)

However, the yield from faith specialist isn't working for me. The DB is correct. One possible reason it may not work in Éa is that I have 2 different specialists that both give Faith. I can't quite deconvolute dll DB code to know if that is a problem or not.

I was poking around the C++/Lua requests thread and found this:

http://forums.civfanatics.com/showpost.php?p=12525425&postcount=39

Did not check it myself, just reporting
 
The reason why it doesn't work in the standard DLL is this function:

Spoiler :
Code:
int CvCity::GetFaithPerTurn() const
{
	VALIDATE_OBJECT

	// No faith during Resistance
	if(IsResistance() || IsRazing())
	{
		return 0;
	}

	int iFaith = GetFaithPerTurnFromBuildings();
	iFaith += GetBaseYieldRateFromTerrain(YIELD_FAITH);
	iFaith += GetFaithPerTurnFromPolicies();
	iFaith += GetFaithPerTurnFromTraits();
	iFaith += GetFaithPerTurnFromReligion();

	// Puppet?
	int iModifier = 0;
	if(IsPuppet())
	{
		iModifier = GC.getPUPPET_FAITH_MODIFIER();
		iFaith *= (100 + iModifier);
		iFaith /= 100;
	}

	return iFaith;
}

It doesn't check faith from specialists.
 
Thanks!

I was tricked by the faith specialist reference in CvCityCitizens::IsAIWantSpecialistRightNow.

Looks like all we need is CvCity::GetFaithPerTurnFromSpecialists(), exposed to Lua for UI.
 
Back
Top Bottom