• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Problem Compiling Debug DLL

Lib.Spi't

Overlord of the Wasteland
Joined
Feb 12, 2009
Messages
3,708
Location
UK
Hey guys, I need to make a debug version cause i am getting a dump CTD,

my dll compiles for release but not for debug,

Here is the Error:

1>CvPlayer.cpp
1>CvPlayer.cpp(13425) : error C2064: term does not evaluate to a function taking 2 arguments

Here is the Code:
Spoiler :
Code:
void CvPlayer::changeSpecialistCivicExtraCommerce(SpecialistTypes eIndex1, CommerceTypes eIndex, int iChange)
{
	FAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0");
	FAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()");
	FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
	FAssertMsg(eIndex < NUM_COMMERCE_TYPES, "eIndex expected to be < NUM_COMMERCE_TYPES");

	if (iChange != 0)
	{
		m_ppaaiSpecialistCivicExtraCommerce[eIndex1][eIndex] = (m_ppaaiSpecialistCivicExtraCommerce[eIndex1][eIndex] + iChange);
		[COLOR="Red"]FAssert(m_ppaaiSpecialistCivicExtraCommerce(eIndex1, eIndex) >= 0);[/COLOR]

		updateSpecialistCivicExtraCommerce();

		AI_makeAssignWorkDirty();
	}
}

And for good measure I attached the files too.

I remember when I merged this element (for allowing civics to change specialist output) there was a bit of a conflict with kmod that I never truly resolved, something about the AI not recognising the benefits of multiple specialists, that kmod fixed, but that wasn't present in the mod comp because it is bts based.

As ever thanks for any help or illumination you can provide!
 

Attachments

You have to replace the m_ppaaiSpecialistCivicExtraCommerce with getSpecialistCivicExtraCommerce. m_ppaaiSpecialistCivicExtraCommerce isn't a function so you can't treat it like one. So it should look like this:
Code:
void CvPlayer::changeSpecialistCivicExtraCommerce(SpecialistTypes eIndex1, CommerceTypes eIndex, int iChange)
{
	FAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0");
	FAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()");
	FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
	FAssertMsg(eIndex < NUM_COMMERCE_TYPES, "eIndex expected to be < NUM_COMMERCE_TYPES");

	if (iChange != 0)
	{
		m_ppaaiSpecialistCivicExtraCommerce[eIndex1][eIndex] = (m_ppaaiSpecialistCivicExtraCommerce[eIndex1][eIndex] + iChange);
		FAssert([COLOR="Red"]getSpecialistCivicExtraCommerce[/COLOR](eIndex1, eIndex) >= 0);

		updateSpecialistCivicExtraCommerce();

		AI_makeAssignWorkDirty();
	}
}
 
And again! :)

Error:
1>CvUnit.cpp
1>CvUnit.cpp(12160) : error C2296: '>=' : illegal, left operand has type 'int (__thiscall CvUnit::* )(void) const'
1>CvUnit.cpp(12160) : error C2297: '>=' : illegal, right operand has type 'int (__thiscall CvUnit::* )(void) const'

Spoiler :
Code:
void CvUnit::changeNoXPCount(int iChange)
{
	m_iNoXPCount += iChange;
[COLOR="Red"]	FAssert(getNoXPCount >= 0);[/COLOR]
}

I am guessing that symbol just need s to change to something else...but what? :D

let me know if you need to see the file too :D
 
Back
Top Bottom