mirror of https://github.com/OpenTTD/OpenTTD
These meddling kids dared to play with magic, but the ancients texts weren't ready for that. Refactors logic to estimate costs that dated to even before OpenTTD 0.1;pull/6911/head
parent
e00908f5e9
commit
42b00c3b39
|
@ -193,11 +193,8 @@ public:
|
||||||
StringID str = STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A;
|
StringID str = STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A;
|
||||||
Company *c = Company::GetIfValid(_local_company);
|
Company *c = Company::GetIfValid(_local_company);
|
||||||
if (c != NULL) {
|
if (c != NULL) {
|
||||||
Money old_money = c->money;
|
|
||||||
c->money = INT64_MAX;
|
|
||||||
assert(_current_company == _local_company);
|
assert(_current_company == _local_company);
|
||||||
CommandCost costclear = DoCommand(tile, 0, 0, DC_NONE, CMD_LANDSCAPE_CLEAR);
|
CommandCost costclear = DoCommand(tile, 0, 0, DC_QUERY_COST, CMD_LANDSCAPE_CLEAR);
|
||||||
c->money = old_money;
|
|
||||||
if (costclear.Succeeded()) {
|
if (costclear.Succeeded()) {
|
||||||
Money cost = costclear.GetCost();
|
Money cost = costclear.GetCost();
|
||||||
if (cost < 0) {
|
if (cost < 0) {
|
||||||
|
|
Loading…
Reference in New Issue