summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-24 20:29:04 +0000
committerrubidium <rubidium@openttd.org>2009-05-24 20:29:04 +0000
commit0d99b6c71cd096599b4805d230483f3e4e958af1 (patch)
tree463b69c3b2ea6f697506be055622229767dfebc4 /src/train_gui.cpp
parent36e71c8df6fe1f4c303d98b609bb9cdd0c4b7e75 (diff)
downloadopenttd-0d99b6c71cd096599b4805d230483f3e4e958af1.tar.xz
(svn r16421) -Codechange: do not unnecessarily remove constness or unnecessarily add it.
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index bda118815..bf16234f2 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -28,7 +28,7 @@ void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2)
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN && IsFrontEngine(v) &&
v->tile == tile &&
- ((Train *)v)->track == TRACK_BIT_DEPOT) {
+ ((const Train *)v)->track == TRACK_BIT_DEPOT) {
if (found != NULL) return; // must be exactly one.
found = v;
}
@@ -81,7 +81,7 @@ void DrawTrainImage(const Vehicle *v, int x, int y, VehicleID selection, int cou
_cur_dpi = &tmp_dpi;
do {
- int width = ((Train *)v)->tcache.cached_veh_length;
+ int width = ((const Train *)v)->tcache.cached_veh_length;
if (dx + width > 0) {
if (dx <= count) {
@@ -228,7 +228,7 @@ void DrawTrainDetails(const Vehicle *v, int left, int right, int y, int vscroll_
do {
SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
DrawSprite(u->GetImage(DIR_W), pal, x + WagonLengthToPixels(4 + dx), y + 6 + (is_custom_sprite(RailVehInfo(u->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0));
- dx += ((Train *)u)->tcache.cached_veh_length;
+ dx += ((const Train *)u)->tcache.cached_veh_length;
u = u->Next();
} while (u != NULL && IsArticulatedPart(u) && u->cargo_cap == 0);