From 15dc498c79500be796ced33f7a4f43fc9789b939 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 24 Oct 2016 18:29:02 +0100 Subject: [PATCH] Fix wrong calculation of infra sharing track deletion train repayment. Head pointer was being used for vehicle value on iteration of train vehicles. --- src/infrastructure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure.cpp b/src/infrastructure.cpp index d0fa7bc337..6e6a34cf19 100644 --- a/src/infrastructure.cpp +++ b/src/infrastructure.cpp @@ -160,7 +160,7 @@ static void RemoveAndSellVehicle(Vehicle *v, bool give_money) /* compute total value and give that to the owner */ Money value = 0; for (Vehicle *u = v->First(); u != NULL; u = u->Next()) { - value += v->value; + value += u->value; } CompanyID old = _current_company; _current_company = v->owner;