Fix wrong calculation of infra sharing track deletion train repayment.
Head pointer was being used for vehicle value on iteration of train vehicles.
This commit is contained in:
@@ -160,7 +160,7 @@ static void RemoveAndSellVehicle(Vehicle *v, bool give_money)
|
|||||||
/* compute total value and give that to the owner */
|
/* compute total value and give that to the owner */
|
||||||
Money value = 0;
|
Money value = 0;
|
||||||
for (Vehicle *u = v->First(); u != NULL; u = u->Next()) {
|
for (Vehicle *u = v->First(); u != NULL; u = u->Next()) {
|
||||||
value += v->value;
|
value += u->value;
|
||||||
}
|
}
|
||||||
CompanyID old = _current_company;
|
CompanyID old = _current_company;
|
||||||
_current_company = v->owner;
|
_current_company = v->owner;
|
||||||
|
Reference in New Issue
Block a user