diff options
author | smatz <smatz@openttd.org> | 2009-05-26 22:45:48 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-26 22:45:48 +0000 |
commit | 5a463c8347fe1e68ab31dda1425e9060d52bfbd6 (patch) | |
tree | 55f5c9de8dcbda6268d003b29af59650594ce27a /src/train_gui.cpp | |
parent | 7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c (diff) | |
download | openttd-5a463c8347fe1e68ab31dda1425e9060d52bfbd6.tar.xz |
(svn r16442) -Codechange: use new Vehicle accessors at more places
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r-- | src/train_gui.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp index bf16234f2..b0a2ca30a 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -24,13 +24,12 @@ void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2) /* find a locomotive in the depot. */ const Vehicle *found = NULL; - const Vehicle *v; - FOR_ALL_VEHICLES(v) { - if (v->type == VEH_TRAIN && IsFrontEngine(v) && - v->tile == tile && - ((const Train *)v)->track == TRACK_BIT_DEPOT) { + const Train *t; + FOR_ALL_TRAINS(t) { + if (IsFrontEngine(t) && t->tile == tile && + t->track == TRACK_BIT_DEPOT) { if (found != NULL) return; // must be exactly one. - found = v; + found = t; } } |