(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.

This commit is contained in:
rubidium
2007-08-30 13:03:56 +00:00
parent 6edf2d3a1b
commit 235ad4ab6b
21 changed files with 164 additions and 147 deletions

View File

@@ -279,7 +279,7 @@ static void DrawDepotWindow(Window *w)
/*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 @@ static int GetVehicleFromDepotWndPt(const Window *w, int x, int y, Vehicle **veh
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);