From 235ad4ab6bf3133517a7a779c398e30f51bdbbad Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 30 Aug 2007 13:03:56 +0000 Subject: (svn r11003) -Codechange: replace Vehicle->next to Vehicle->Next() and Vehicle->SetNext() so we can trap instances that change a next pointer and (in the future) update the first/previous pointers based on that. --- src/train_gui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/train_gui.cpp') diff --git a/src/train_gui.cpp b/src/train_gui.cpp index f88ab54ab..cf8dcbc15 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -100,7 +100,7 @@ void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, Vehicle } dx += width; - v = v->next; + v = v->Next(); } while (dx < count && v != NULL); if (highlight_l != highlight_r) { @@ -176,7 +176,7 @@ static void DrawTrainDetailsWindow(Window *w) do { act_cargo[u->cargo_type] += u->cargo.Count(); max_cargo[u->cargo_type] += u->cargo_cap; - } while ((u = u->next) != NULL); + } while ((u = u->Next()) != NULL); /* Set scroll-amount seperately from counting, as to not compute num double * for more carriages of the same type @@ -188,7 +188,7 @@ static void DrawTrainDetailsWindow(Window *w) } else { do { if (!IsArticulatedPart(u) || u->cargo_cap != 0) num++; - } while ((u = u->next) != NULL); + } while ((u = u->Next()) != NULL); } SetVScrollCount(w, num); @@ -249,7 +249,7 @@ static void DrawTrainDetailsWindow(Window *w) 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 += u->u.rail.cached_veh_length; - u = u->next; + u = u->Next(); } while (u != NULL && IsArticulatedPart(u) && u->cargo_cap == 0); px = x + WagonLengthToPixels(dx) + 2; @@ -271,7 +271,7 @@ static void DrawTrainDetailsWindow(Window *w) } else { /* Move to the next line */ do { - v = v->next; + v = v->Next(); } while (v != NULL && IsArticulatedPart(v) && v->cargo_cap == 0); } if (v == NULL) return; -- cgit v1.2.3-54-g00ecf