void CvUnit::changeHiddenNationality(int iNewValue)
{
if (iNewValue != 0)
{
if (m_iHiddenNationality + iNewValue == 0)
{
updatePlunder(-1, false);
setBlockading(false);
m_iHiddenNationality += iNewValue;
if (getGroup()->getNumUnits() > 1)
{
joinGroup(NULL, true);
}
updatePlunder(1, false);
}
else
{
m_iHiddenNationality += iNewValue;
}
}
}
Far as I understand the source code this function alone is bugged and the following lines should be removed:
updatePlunder(-1, false);
updatePlunder(1, false);
Even with removal of the hack (in CvPlot::changeBlockadedCount) these lines do not cancel each other because the removal of HN will change which teams are considered enemies.
Furthermore I do not see any purpose for these lines.
Edit: I have not looked into the "joinGroup" part - so this may somehow add some complexity to the problem.