diff src/roadveh_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 (2007-08-30)
parents 307a03e3f031
children 614aeff92fd3
line wrap: on
line diff
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -46,7 +46,7 @@
 		}
 
 		dx += length;
-		v = v->next;
+		v = v->Next();
 	} while (v != NULL && dx < max_length);
 }
 
@@ -65,7 +65,7 @@
 		/* Add space for the cargo amount for each part. */
 		do {
 			height_extension += 11;
-		} while ((v = v->next) != NULL);
+		} while ((v = v->Next()) != NULL);
 
 		ResizeWindow(w, 0, height_extension);
 	} break;
@@ -128,7 +128,7 @@
 
 			memset(max_cargo, 0, sizeof(max_cargo));
 
-			for (const Vehicle *u = v; u != NULL; u = u->next) {
+			for (const Vehicle *u = v; u != NULL; u = u->Next()) {
 				max_cargo[u->cargo_type] += u->cargo_cap;
 			}
 
@@ -153,7 +153,7 @@
 			SetDParamStr(0, capacity);
 			DrawStringTruncated(34, 67 + y_offset, STR_JUST_STRING, 0, w->width - 34);
 
-			for (const Vehicle *u = v; u != NULL; u = u->next) {
+			for (const Vehicle *u = v; u != NULL; u = u->Next()) {
 				str = STR_8812_EMPTY;
 				if (!u->cargo.Empty()) {
 					SetDParam(0, u->cargo_type);