mirror of https://github.com/OpenTTD/OpenTTD
parent
142321da79
commit
146827c458
|
@ -262,7 +262,7 @@ void CommandHelperBase::InternalPostResult(const CommandCost &res, TileIndex til
|
||||||
}
|
}
|
||||||
} else if (estimate_only) {
|
} else if (estimate_only) {
|
||||||
ShowEstimatedCostOrIncome(res.GetCost(), x, y);
|
ShowEstimatedCostOrIncome(res.GetCost(), x, y);
|
||||||
} else if (!only_sending && res.GetCost() != 0 && tile != 0 && IsLocalCompany() && _game_mode != GM_EDITOR) {
|
} else if (!only_sending && tile != 0 && IsLocalCompany() && _game_mode != GM_EDITOR) {
|
||||||
/* Only show the cost animation when we did actually
|
/* Only show the cost animation when we did actually
|
||||||
* execute the command, i.e. we're not sending it to
|
* execute the command, i.e. we're not sending it to
|
||||||
* the server, when it has cost the local company
|
* the server, when it has cost the local company
|
||||||
|
|
|
@ -1188,7 +1188,7 @@ CargoPayment::~CargoPayment()
|
||||||
if (this->visual_transfer != 0) {
|
if (this->visual_transfer != 0) {
|
||||||
ShowFeederIncomeAnimation(this->front->x_pos, this->front->y_pos,
|
ShowFeederIncomeAnimation(this->front->x_pos, this->front->y_pos,
|
||||||
this->front->z_pos, this->visual_transfer, -this->visual_profit);
|
this->front->z_pos, this->visual_transfer, -this->visual_profit);
|
||||||
} else if (this->visual_profit != 0) {
|
} else {
|
||||||
ShowCostOrIncomeAnimation(this->front->x_pos, this->front->y_pos,
|
ShowCostOrIncomeAnimation(this->front->x_pos, this->front->y_pos,
|
||||||
this->front->z_pos, -this->visual_profit);
|
this->front->z_pos, -this->visual_profit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 x World X position of the animation location.
|
||||||
* @param y World Y position of the animation location.
|
* @param y World Y position of the animation location.
|
||||||
* @param z World Z 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)
|
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
|
||||||
{
|
{
|
||||||
|
if (cost == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Point pt = RemapCoords(x, y, z);
|
Point pt = RemapCoords(x, y, z);
|
||||||
StringID msg = STR_INCOME_FLOAT_COST;
|
StringID msg = STR_INCOME_FLOAT_COST;
|
||||||
|
|
||||||
|
|
|
@ -1060,7 +1060,7 @@ void CallVehicleTicks()
|
||||||
|
|
||||||
if (!IsLocalCompany()) continue;
|
if (!IsLocalCompany()) continue;
|
||||||
|
|
||||||
if (res.Succeeded() && res.GetCost() != 0) {
|
if (res.Succeeded()) {
|
||||||
ShowCostOrIncomeAnimation(x, y, z, res.GetCost());
|
ShowCostOrIncomeAnimation(x, y, z, res.GetCost());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue