Feature: Infinite money mode (#11902)
This commit is contained in:
@@ -220,7 +220,7 @@ bool Vehicle::NeedsServicing() const
|
||||
* There are a lot more reasons for autoreplace to fail than we can test here reasonably. */
|
||||
bool pending_replace = false;
|
||||
Money needed_money = c->settings.engine_renew_money;
|
||||
if (needed_money > c->money) return false;
|
||||
if (needed_money > GetAvailableMoney(c->index)) return false;
|
||||
|
||||
for (const Vehicle *v = this; v != nullptr; v = (v->type == VEH_TRAIN) ? Train::From(v)->GetNextUnit() : nullptr) {
|
||||
bool replace_when_old = false;
|
||||
@@ -258,7 +258,7 @@ bool Vehicle::NeedsServicing() const
|
||||
* We want 2*(the price of the new vehicle) without looking at the value of the vehicle we are going to sell. */
|
||||
pending_replace = true;
|
||||
needed_money += 2 * Engine::Get(new_engine)->GetCost();
|
||||
if (needed_money > c->money) return false;
|
||||
if (needed_money > GetAvailableMoney(c->index)) return false;
|
||||
}
|
||||
|
||||
return pending_replace;
|
||||
|
Reference in New Issue
Block a user