(svn r3570) - Explicitly update v->first in TrainConsistChanged() if necessary, as this is far faster than brute forcing it later.
--- a/train_cmd.c Mon Feb 06 23:28:07 2006 +0000
+++ b/train_cmd.c Tue Feb 07 18:55:06 2006 +0000
@@ -93,6 +93,9 @@
const RailVehicleInfo *rvi_u = RailVehInfo(u->engine_type);
uint16 veh_len;
+ // Update the v->first cache. This is faster than having to brute force it later.
+ if (u->first == NULL) u->first = v;
+
// update the 'first engine'
u->u.rail.first_engine = (v == u) ? INVALID_VEHICLE : first_engine;