umm... Guys, I must be missing something vital, cause I don't understand how what's happening is making sense to the two of you...
I'll try to break it down a bit then
Here is the code in use for the above pics (exactly as you gave it to me before EF):
Code:
szTempBuffer.Format(NEWLINE L"About to check IF (getGlobalReligionYield (%d) != NO_RELIGION (-1))", kBuilding.getGlobalReligionYield());
I'm stopping here because this is the text output you are seeing, and apparently what you don't understand as being as beautifully helpful as it is.
It literally says:
-----------------------
Make szTempBuffer hold some information for me, m'Kay? And it's gonna look purdy, so translate this stuff special like.
First, get me on a new line away from the previous drivel. Then write exactly this:
About to check IF (getGlobalReligionYield (
Now at this point, STOP and check out a number in the code for me, will you? It'll be an integer, I'll tell you which integer in a moment. Once you print that number, then write exactly this:
) != NO_RELIGION (-1))
Now, that number to squeeze between those two statements I want you to write? You can find it by checking out
kBuilding.getGlobalReligionYield(). Whatever that function answers you with, print it in between those two statements, then go back to running the rest of the code like normal.
--------------------
That is the only piece of the entire puzzle that we are really looking at, because it is the only part which actually happens right now, and it performs the job properly. Since in the screenshot you posted, that
%d got replaced with a
-1, we know that the function is always returning to you with a NO_RELIGION. Thus the next IF check does exactly what it is designed to do and DOESN'T RUN, because it does not see any reason to do so.
So the error in your code is somewhere in CvInfos, or in your XML. We need to see both of those to help any more really. I tend to be a tad too lazy to look through attached code files since normally there are only a couple of relevant lines and finding them can be a PITA if you don't know the code yourself. Just show us the XML for a building which makes use of this function so we can see if there is a typo involved, and show us the CvInfos functions to read the XML, and again to respond to queries.
EDIT:
Ok, I decided to look at your attached files anyway. You don't include your BuildingInfos.xml file, so I am going to assume that you forgot to add your new field to any buildings, because I remember you hinting earlier that you didn't need to add anything to them. You do need to though.
Some buildings already have a line like:
<GlobalReligionCommerce>RELIGION_ISLAM</GlobalReligionCommerce>
And so they work great with commerces. But you want them to work with Yields now, so need to use the new field which you added yourself
<GlobalReligionYield>RELIGION_ISLAM</GlobalReligionYield>
Once you do that, things should start to work beyond the point where they currently break down.