diff options
author | rubidium <rubidium@openttd.org> | 2007-08-30 13:03:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-30 13:03:56 +0000 |
commit | cb7eaff3534c1d18c9c8bc06be04ceb437d97765 (patch) | |
tree | 141633b357757cb790c904dc033f8479d58ba5e5 /src/articulated_vehicles.cpp | |
parent | ac5fde61fb03059daee4b505dcaad84f21b93857 (diff) | |
download | openttd-cb7eaff3534c1d18c9c8bc06be04ceb437d97765.tar.xz |
(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.
Diffstat (limited to 'src/articulated_vehicles.cpp')
-rw-r--r-- | src/articulated_vehicles.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp index 2fad99769..6fdfb1339 100644 --- a/src/articulated_vehicles.cpp +++ b/src/articulated_vehicles.cpp @@ -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); |