Castor_Troy
Warlord
Hello, I recently moved onto the SDK since it open immense new features to Civ gameplay, but as I am not a C++ knower I got stuck a bit on a problem.It is related to the FFH2 code about CreateUnitOnCombat. Copy and pasteing the code isnt enough since I dont have a Alive system, nor the hidden nationality promotion, nor a immunity to capture so the red lines i think can dissapear as for the yellow I think that has to be changed to something that says check the xml to see what type of unit to create (my guess).
I would apreciate if any of the experienced / knowers of C++ can take a look and suggest the changes. The code im reffering too is in the spoiler:
Thank you for your time and patience!
I would apreciate if any of the experienced / knowers of C++ can take a look and suggest the changes. The code im reffering too is in the spoiler:
Spoiler :
Code:
if (m_pUnitInfo->getUnitCreateFromCombat() != NO_UNIT)
{
[COLOR="Red"] if (!pLoser->isImmuneToCapture() && pLoser->isAlive() && GC.getUnitInfo((UnitTypes)pLoser->getUnitType()).getEquipmentPromotion() == NO_PROMOTION[/COLOR])
{
if (GC.getGameINLINE().getSorenRandNum(100, "Create Unit from Combat") <= m_pUnitInfo->getUnitCreateFromCombatChance())
{
pUnit = GET_PLAYER(getOwnerINLINE()).initUnit((UnitTypes)m_pUnitInfo->getUnitCreateFromCombat(), plot()->getX_INLINE(), plot()->getY_INLINE());
[COLOR="Yellow"] pUnit->setDuration(getDuration());[/COLOR]
[COLOR="Red"] if (isHiddenNationality())
{
pUnit->setHasPromotion((PromotionTypes)GC.getDefineINT("HIDDEN_NATIONALITY_PROMOTION"), true);
}
iUnit = NO_UNIT;[/COLOR]
}
}
}
Thank you for your time and patience!