(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 ac5fde61fb
commit cb7eaff353
21 changed files with 164 additions and 147 deletions

View File

@@ -41,11 +41,11 @@ void AddArticulatedParts(Vehicle **vl, VehicleType type)
/* Attempt to use pre-allocated vehicles until they run out. This can happen
* if the callback returns different values depending on the cargo type. */
u->next = vl[i];
if (u->next == NULL) u->next = new InvalidVehicle();
if (u->next == NULL) return;
u->SetNext(vl[i]);
if (u->Next() == NULL) u->SetNext(new InvalidVehicle());
if (u->Next() == NULL) return;
u = u->next;
u = u->Next();
EngineID engine_type = GetFirstEngineOfType(type) + GB(callback, 0, 7);
bool flip_image = HASBIT(callback, 7);