diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 22:55:41 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 22:55:41 +0000 |
commit | da5661a0c8870c532c393ec3d330c3fbb44eb8ac (patch) | |
tree | 93b9332d7e83e012a46777e2baf91bf323ea9fe9 /src/openttd.cpp | |
parent | c4b627af422075ce4a0e1026c52f871dd3f146c0 (diff) | |
download | openttd-da5661a0c8870c532c393ec3d330c3fbb44eb8ac.tar.xz |
(svn r16393) -Codechange: move VehicleRail to Train.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 90404cae3..5268de747 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1127,17 +1127,18 @@ void StateGameLoop() case VEH_TRAIN: { uint length = 0; - for (Vehicle *u = v; u != NULL; u = u->Next()) length++; + Train *t = (Train *)v; + for (Vehicle *u = t; u != NULL; u = u->Next()) length++; - VehicleRail *wagons = MallocT<VehicleRail>(length); + TrainCache *wagons = MallocT<TrainCache>(length); length = 0; - for (Vehicle *u = v; u != NULL; u = u->Next()) wagons[length++] = u->u.rail; + for (Train *u = t; u != NULL; u = u->Next()) wagons[length++] = u->tcache; - TrainConsistChanged((Train *)v, true); + TrainConsistChanged(t, true); length = 0; - for (Vehicle *u = v; u != NULL; u = u->Next()) { - if (memcmp(&wagons[length], &u->u.rail, sizeof(VehicleRail)) != 0) { + for (Train *u = t; u != NULL; u = u->Next()) { + if (memcmp(&wagons[length], &u->tcache, sizeof(TrainCache)) != 0) { DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i, wagon %i\n", v->index, (int)v->owner, v->unitnumber, length); } length++; |