Skip to content

Commit

Permalink
Fix bugs with (1-19) implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Jun 12, 2024
1 parent 157cfc8 commit 45b75c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CvGameCoreDLL_Expansion2/CvUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,7 @@ void CvUnit::reset(int iID, UnitTypes eUnit, PlayerTypes eOwner, bool bConstruct
{
m_Promotions.Reset();

m_terrainIgnoreCostCount.clear();
m_terrainDoubleMoveCount.clear();
#if defined(MOD_PROMOTIONS_HALF_MOVE)
m_terrainHalfMoveCount.clear();
Expand All @@ -1749,6 +1750,7 @@ void CvUnit::reset(int iID, UnitTypes eUnit, PlayerTypes eOwner, bool bConstruct
m_extraTerrainAttackPercent.clear();
m_extraTerrainDefensePercent.clear();

m_featureIgnoreCostCount.clear();
m_featureDoubleMoveCount.clear();
#if defined(MOD_PROMOTIONS_HALF_MOVE)
m_featureHalfMoveCount.clear();
Expand Down Expand Up @@ -27189,6 +27191,7 @@ void CvUnit::setHasPromotion(PromotionTypes eIndex, bool bNewValue)
{
changeExtraTerrainAttackPercent(((TerrainTypes)iI), (thisPromotion.GetTerrainAttackPercent(iI) * iChange));
changeExtraTerrainDefensePercent(((TerrainTypes)iI), (thisPromotion.GetTerrainDefensePercent(iI) * iChange));
changeTerrainIgnoreCostCount(((TerrainTypes)iI), ((thisPromotion.GetTerrainIgnoreCost(iI)) ? iChange : 0));
changeTerrainDoubleMoveCount(((TerrainTypes)iI), ((thisPromotion.GetTerrainDoubleMove(iI)) ? iChange : 0));
#if defined(MOD_PROMOTIONS_HALF_MOVE)
changeTerrainHalfMoveCount(((TerrainTypes)iI), ((thisPromotion.GetTerrainHalfMove(iI)) ? iChange : 0));
Expand All @@ -27204,6 +27207,7 @@ void CvUnit::setHasPromotion(PromotionTypes eIndex, bool bNewValue)
{
changeExtraFeatureAttackPercent(((FeatureTypes)iI), (thisPromotion.GetFeatureAttackPercent(iI) * iChange));
changeExtraFeatureDefensePercent(((FeatureTypes)iI), (thisPromotion.GetFeatureDefensePercent(iI) * iChange));
changeFeatureIgnoreCostCount(((FeatureTypes)iI), ((thisPromotion.GetFeatureIgnoreCost(iI)) ? iChange : 0));
changeFeatureDoubleMoveCount(((FeatureTypes)iI), ((thisPromotion.GetFeatureDoubleMove(iI)) ? iChange : 0));
#if defined(MOD_PROMOTIONS_HALF_MOVE)
changeFeatureHalfMoveCount(((FeatureTypes)iI), ((thisPromotion.GetFeatureHalfMove(iI)) ? iChange : 0));
Expand Down
6 changes: 6 additions & 0 deletions CvGameCoreDLL_Expansion2/CvUnitMovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ int CvUnitMovement::GetCostsForMove(const CvUnit* pUnit, const CvPlot* pFromPlot
bIgnoreTerrainCost = true;
bNoRiverCrossingPenalty = true; // as specified by Incan UA
}
else if (pToPlot->isHills() && pUnit->isTerrainIgnoreCost(TERRAIN_HILL))
{
bIgnoreTerrainCost = true;
if (/*FALSE*/ GD_INT_GET(IGNORE_SPECIFIC_TERRAIN_COSTS_INCLUDES_RIVERS) > 0)
bNoRiverCrossingPenalty = true;
}
else if (pUnit->isTerrainIgnoreCost(eToTerrain))
{
bIgnoreTerrainCost = true;
Expand Down

0 comments on commit 45b75c4

Please sign in to comment.