In 3.17 we introduced a bug that results in players getting out-of-sync when performing an amphibious landing by moving transports directly onto an enemy-occupied tile. Here's how to fix it:
In CvSelectionGroup::groupAmphibMove, replace the following code:
by the following code segment:
In CvSelectionGroup::groupAmphibMove, replace the following code:
Code:
std::vector<CvUnit*> aCargoUnits;
pLoopUnit1->getCargoUnits(aCargoUnits);
std::set<CvSelectionGroup*> aCargoGroups;
for (uint i = 0; i < aCargoUnits.size(); ++i)
{
aCargoGroups.insert(aCargoUnits[i]->getGroup());
}
std::set<CvSelectionGroup*>::iterator it;
for (it = aCargoGroups.begin(); it != aCargoGroups.end(); ++it)
{
CvSelectionGroup* pGroup = *it;
if (pGroup->canAllMove())
{
FAssert(!pGroup->at(pPlot->getX_INLINE(), pPlot->getY_INLINE()));
pGroup->pushMission(MISSION_MOVE_TO, pPlot->getX_INLINE(), pPlot->getY_INLINE(), (MOVE_IGNORE_DANGER | iFlags));
bLanding = true;
}
}
by the following code segment:
Code:
std::vector<CvUnit*> aCargoUnits;
pLoopUnit1->getCargoUnits(aCargoUnits);
std::vector<CvSelectionGroup*> aCargoGroups;
for (uint i = 0; i < aCargoUnits.size(); ++i)
{
CvSelectionGroup* pGroup = aCargoUnits[i]->getGroup();
if (std::find(aCargoGroups.begin(), aCargoGroups.end(), pGroup) == aCargoGroups.end())
{
aCargoGroups.push_back(aCargoUnits[i]->getGroup());
}
}
for (uint i = 0; i < aCargoGroups.size(); ++i)
{
CvSelectionGroup* pGroup = aCargoGroups[i];
if (pGroup->canAllMove())
{
FAssert(!pGroup->at(pPlot->getX_INLINE(), pPlot->getY_INLINE()));
pGroup->pushMission(MISSION_MOVE_TO, pPlot->getX_INLINE(), pPlot->getY_INLINE(), (MOVE_IGNORE_DANGER | iFlags));
bLanding = true;
}
}