mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
generate at least one resource / creature
This commit is contained in:
parent
652e2ddf3f
commit
977d8e041a
@ -1269,7 +1269,10 @@ int GrowthInfo::totalGrowth() const
|
||||
for(const Entry &entry : entries)
|
||||
ret += entry.count;
|
||||
|
||||
return ret * percent / 100;
|
||||
auto retCalc = ret * percent / 100;
|
||||
if(retCalc == 0 && ret > 0) //generate at least one
|
||||
retCalc = 1;
|
||||
return retCalc;
|
||||
}
|
||||
|
||||
void CGTownInstance::fillUpgradeInfo(UpgradeInfo & info, const CStackInstance &stack) const
|
||||
|
@ -199,6 +199,9 @@ ui32 CGMine::defaultResProduction() const
|
||||
ui32 CGMine::getProducedQuantity() const
|
||||
{
|
||||
auto * playerSettings = cb->getPlayerSettings(getOwner());
|
||||
auto ret = producedQuantity * playerSettings->handicap.percentIncome / 100;
|
||||
if(ret == 0 && producedQuantity > 0) // create at least 1 resource
|
||||
ret = 1;
|
||||
return producedQuantity * playerSettings->handicap.percentIncome / 100;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user