Fix #9877: GS could trigger 'Cost: 0' cost message (#9878)

This commit is contained in:
Charles Pigott
2022-05-05 19:51:56 +01:00
committed by GitHub
parent 142321da79
commit 146827c458
4 changed files with 7 additions and 4 deletions

View File

@@ -565,7 +565,7 @@ void ShowEstimatedCostOrIncome(Money cost, int x, int y)
}
/**
* Display animated income or costs on the map.
* Display animated income or costs on the map. Does nothing if cost is zero.
* @param x World X position of the animation location.
* @param y World Y position of the animation location.
* @param z World Z position of the animation location.
@@ -573,6 +573,9 @@ void ShowEstimatedCostOrIncome(Money cost, int x, int y)
*/
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
{
if (cost == 0) {
return;
}
Point pt = RemapCoords(x, y, z);
StringID msg = STR_INCOME_FLOAT_COST;