This thread is to post simple working SDK changes to help begining programmers get an idea of how they can use the SDK without having to get into deep in depth programming.
Please don't use this thread to ask questions on things that aren't working or post non-working code. Start new threads in the creation and customization forum for that.
1. So that the promotion prereqs are AND reqs instead of OR reqs
CvUnit.cpp CvUnit::canAcquirePromotion:
Original:
Changed to:
2. So that player owned animals act like normal units
CvUnit.cpp CvUnit::canMoveInto():
Origional:
Changed to:
3. So that animals dont disappear when barbarians appear
CvGame.cpp CvGame::createBarbarianUnits():
Commented out the following lines:
4. So that civs with the Scorched Earth trait auto-raze cities
CvPlayer.cpp CvPlayer::acquireCity()
Original:
Changed to:
5. So that civs with the Agnostic trait cant adopt a state religion
CvPlayer.cpp CvPlayer::canConvert()
Added:
Please don't use this thread to ask questions on things that aren't working or post non-working code. Start new threads in the creation and customization forum for that.
1. So that the promotion prereqs are AND reqs instead of OR reqs
CvUnit.cpp CvUnit::canAcquirePromotion:
Original:
Code:
if (GC.getPromotionInfo(ePromotion).getPrereqOrPromotion1() != NO_PROMOTION)
{
if (!isHasPromotion((PromotionTypes)(GC.getPromotionInfo(ePromotion).getPrereqOrPromotion1())))
{
if ((GC.getPromotionInfo(ePromotion).getPrereqOrPromotion2() == NO_PROMOTION) || !isHasPromotion((PromotionTypes)(GC.getPromotionInfo(ePromotion).getPrereqOrPromotion2())))
{
return false;
}
}
}
Changed to:
Code:
if (GC.getPromotionInfo(ePromotion).getPrereqOrPromotion1() != NO_PROMOTION)
{
if (!isHasPromotion((PromotionTypes)(GC.getPromotionInfo(ePromotion).getPrereqOrPromotion1())))
{
return false;
}
}
if (GC.getPromotionInfo(ePromotion).getPrereqOrPromotion2() != NO_PROMOTION)
{
if (!isHasPromotion((PromotionTypes)(GC.getPromotionInfo(ePromotion).getPrereqOrPromotion2())))
{
return false;
}
}
2. So that player owned animals act like normal units
CvUnit.cpp CvUnit::canMoveInto():
Origional:
Code:
if (isAnimal())
{
if (pPlot->isOwned())
{
return false;
}
Changed to:
Code:
if (isAnimal() && isBarbarian())
{
if (pPlot->isOwned())
{
return false;
}
3. So that animals dont disappear when barbarians appear
CvGame.cpp CvGame::createBarbarianUnits():
Commented out the following lines:
Code:
// CvUnit* pLoopUnit;
// for (pLoopUnit = GET_PLAYER(BARBARIAN_PLAYER).firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = GET_PLAYER(BARBARIAN_PLAYER).nextUnit(&iLoop))
// {
// if (pLoopUnit->isAnimal())
// {
// pLoopUnit->kill(false);
// break;
// }
// }
4. So that civs with the Scorched Earth trait auto-raze cities
CvPlayer.cpp CvPlayer::acquireCity()
Original:
Code:
if (bConquest)
{
if (((pOldCity->getHighestPopulation() == 1) && !(GC.getGameINLINE().isOption(GAMEOPTION_NO_CITY_RAZING))) ||
((GC.getGameINLINE().getMaxCityElimination() > 0) && !(GC.getGameINLINE().isOption(GAMEOPTION_NO_CITY_RAZING))) ||
(GC.getGameINLINE().isOption(GAMEOPTION_ONE_CITY_CHALLENGE) && isHuman()))
{
Changed to:
Code:
if (bConquest)
{
if (((pOldCity->getHighestPopulation() == 1) && !(GC.getGameINLINE().isOption(GAMEOPTION_NO_CITY_RAZING))) ||
((GC.getGameINLINE().getMaxCityElimination() > 0) && !(GC.getGameINLINE().isOption(GAMEOPTION_NO_CITY_RAZING))) ||
(GC.getGameINLINE().isOption(GAMEOPTION_ONE_CITY_CHALLENGE) && isHuman()) ||
(hasTrait((TraitTypes)GC.getInfoTypeForString("TRAIT_SCORCHED_EARTH"))))
{
5. So that civs with the Agnostic trait cant adopt a state religion
CvPlayer.cpp CvPlayer::canConvert()
Added:
Code:
if (hasTrait((TraitTypes)GC.getInfoTypeForString("TRAIT_AGNOSTIC")))
{
return false;
}