mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix initialization of gold pile from random resource with fixed amount
This commit is contained in:
@@ -263,6 +263,9 @@ void CGResource::pickRandomObject(CRandomGenerator & rand)
|
||||
ID = Obj::RESOURCE;
|
||||
subID = rand.nextInt(EGameResID::WOOD, EGameResID::GOLD);
|
||||
setType(ID, subID);
|
||||
|
||||
if (subID == EGameResID::GOLD && amount != CGResource::RANDOM_AMOUNT)
|
||||
amount *= CGResource::GOLD_AMOUNT_MULTIPLIER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +278,7 @@ void CGResource::initObj(CRandomGenerator & rand)
|
||||
switch(resourceID().toEnum())
|
||||
{
|
||||
case EGameResID::GOLD:
|
||||
amount = rand.nextInt(5, 10) * 100;
|
||||
amount = rand.nextInt(5, 10) * CGResource::GOLD_AMOUNT_MULTIPLIER;
|
||||
break;
|
||||
case EGameResID::WOOD: case EGameResID::ORE:
|
||||
amount = rand.nextInt(6, 10);
|
||||
|
||||
Reference in New Issue
Block a user