1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

generate at least one resource / creature

This commit is contained in:
Laserlicht
2024-07-26 00:55:47 +02:00
committed by GitHub
parent 652e2ddf3f
commit 977d8e041a
2 changed files with 7 additions and 1 deletions

View File

@@ -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;
}