Mercurial > hg > openttd
diff src/depot_gui.cpp @ 7492:09743324277c draft
(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.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 30 Aug 2007 13:03:56 +0000 |
parents | 1af81beda3fb |
children | 797ff0b0e0a5 |
line wrap: on
line diff
--- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -279,7 +279,7 @@ /*Draw the train counter */ i = 0; u = v; - do i++; while ( (u=u->next) != NULL); // Determine length of train + do i++; while ((u = u->Next()) != NULL); // Determine length of train SetDParam(0, i); // Set the counter DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, 0); // Draw the counter } @@ -356,7 +356,7 @@ x += skip; /* find the vehicle in this row that was clicked */ - while (v != NULL && (x -= v->u.rail.cached_veh_length) >= 0) v = v->next; + while (v != NULL && (x -= v->u.rail.cached_veh_length) >= 0) v = v->Next(); /* if an articulated part was selected, find its parent */ while (v != NULL && IsArticulatedPart(v)) v = GetPrevVehicleInChain(v);