Afforess
The White Wizard
I want to make it so Masters can end vassal agreements, and I have it partially working. Right now, Masters can end vassal agreements at will, but so can vassals. Here's the section of code I'm editing, with the change colored.
Now, I think I need to change it to something like this, but it brings up errors in codeblocks.
The errors codeblocks gives are:
Any idea what I'm doing wrong, and what the code should look like?
Code:
bool CvDeal::isCancelable(PlayerTypes eByPlayer, CvWString* pszReason)
{
if (isUncancelableVassalDeal(eByPlayer, pszReason))
{
[COLOR=Red] return true;[/COLOR] (It was false)
}
int iTurns = turnsToCancel(eByPlayer);
if (pszReason)
{
if (iTurns > 0)
{
*pszReason = gDLL->getText("TXT_KEY_MISC_DEAL_NO_CANCEL", iTurns);
}
}
return (iTurns <= 0);
}
Now, I think I need to change it to something like this, but it brings up errors in codeblocks.
Code:
bool CvDeal::isCancelable(PlayerTypes eByPlayer, CvWString* pszReason)
{
if (isUncancelableVassalDeal(eByPlayer, pszReason))
{
/*************************************************************************************************/
/** Afforess Realistic Diplomacy 08/13/09 */
/** */
/** */
/*************************************************************************************************/
if (!(GET_TEAM(getTeam()).isAVassal()))
{
return false;
}
else
{
return true;
}
/*************************************************************************************************/
/** Afforess Realistic Diplomacy END */
/*************************************************************************************************/
}
int iTurns = turnsToCancel(eByPlayer);
if (pszReason)
{
if (iTurns > 0)
{
*pszReason = gDLL->getText("TXT_KEY_MISC_DEAL_NO_CANCEL", iTurns);
}
}
return (iTurns <= 0);
}
The errors codeblocks gives are:
CvDeal.cpp(1085) : error C2228: left of '.isAVassal' must have class/struct/union type
CvDeal.cpp(1085) : error C3861: 'getTeam': identifier not found, even with argument-dependent
Any idea what I'm doing wrong, and what the code should look like?