(svn r11033) -Fix [FS#1184] (r11011): building articulated vehicles failed. Based on a patch by SmatZ.

This commit is contained in:
rubidium 2007-09-01 20:09:26 +00:00
parent 05581edf59
commit 52e1d03ec7
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,7 @@ void AddArticulatedParts(Vehicle **vl, VehicleType type)
if (u->Next() == NULL) u->SetNext(new InvalidVehicle());
if (u->Next() == NULL) return;
Vehicle *previous = u;
u = u->Next();
EngineID engine_type = GetFirstEngineOfType(type) + GB(callback, 0, 7);
@ -106,6 +107,8 @@ void AddArticulatedParts(Vehicle **vl, VehicleType type)
} break;
}
previous->SetNext(u);
if (flip_image) u->spritenum++;
VehiclePositionChanged(u);