2
0
Эх сурвалжийг харах

CGameState::initStartingBonus: fix amounts for wood and ore bonus

In original game when wood and ore bonus is choosen you always get same amount of both resources.
Arseniy Shestakov 9 жил өмнө
parent
commit
725cce368f
1 өөрчлөгдсөн 3 нэмэгдсэн , 2 устгасан
  1. 3 2
      lib/CGameState.cpp

+ 3 - 2
lib/CGameState.cpp

@@ -1665,8 +1665,9 @@ void CGameState::initStartingBonus()
 				int res = VLC->townh->factions[scenarioOps->playerInfos[elem.first].castle]->town->primaryRes;
 				if(res == Res::WOOD_AND_ORE)
 				{
-					elem.second.resources[Res::WOOD] += rand.nextInt(5, 10);
-					elem.second.resources[Res::ORE] += rand.nextInt(5, 10);
+					int amount = rand.nextInt(5, 10);
+					elem.second.resources[Res::WOOD] += amount;
+					elem.second.resources[Res::ORE] += amount;
 				}
 				else
 				{