ThorHammerz
zzz
- Joined
- Jul 31, 2014
- Messages
- 836
Has anyone gotten civilian units (i.e. workers) to be captured while they are embarked (i.e. Trireme attacks worker, worker becomes captured, without the regular battle sequence)?
Changing the column "CaptureWhileEmbarked" in the Units table seems to do nothing by itself, and the .DLL code is a little convoluted
.
The parts of the code I have narrowed down the conditions to are:
CvUnitCombat.cpp line 2500
and
CvUnit.cpp line ~13060
Are there more checks placed elsewhere that I missed? I tried disabling/commenting out the "!pLoopUnit->isEmbarked()" parts, but to no success.
Changing the column "CaptureWhileEmbarked" in the Units table seems to do nothing by itself, and the .DLL code is a little convoluted

The parts of the code I have narrowed down the conditions to are:
CvUnitCombat.cpp line 2500
Code:
CvUnitCombat::ATTACK_RESULT CvUnitCombat::Attack(CvUnit& kAttacker, CvPlot& targetPlot, ATTACK_OPTION eOption)
if(!kAttacker.isNoCapture() && (!pDefender->isEmbarked() || pDefender->getUnitInfo().IsCaptureWhileEmbarked()) && pDefender->getCaptureUnitType(GET_PLAYER(pDefender->getOwner()).getCivilizationType()) != NO_UNIT)
and
CvUnit.cpp line ~13060
Code:
void CvUnit::setXY(int iX, int iY, bool bGroup, bool bUpdate, bool bShow, bool bCheckPlotVisible, bool bNoMove)
if((!pLoopUnit->isEmbarked() || pLoopUnit->getUnitInfo().IsCaptureWhileEmbarked()) && pLoopUnit->getCaptureUnitType(GET_PLAYER(pLoopUnit->getOwner()).getCivilizationType()) != NO_UNIT)
Are there more checks placed elsewhere that I missed? I tried disabling/commenting out the "!pLoopUnit->isEmbarked()" parts, but to no success.