diff options
author | smatz <smatz@openttd.org> | 2009-07-02 00:17:27 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-07-02 00:17:27 +0000 |
commit | 77eaefb61c9d1cbd4e6347e3fc042565a5b7572e (patch) | |
tree | 503571b0002d4de1e0f27eb6aca694e692c6a795 /src/saveload | |
parent | d86e17d65adebad6f0213451b99645be3494ea45 (diff) | |
download | openttd-77eaefb61c9d1cbd4e6347e3fc042565a5b7572e.tar.xz |
(svn r16720) -Codechange: make Set/ClearFrontEngine(), Set/ClearArticulatedPart(), Set/ClearWagon(), Set/ClearEngine(), Set/ClearFreeWagon() and Set/ClearMultiheaded() members of Train
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/vehicle_sl.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index bbe0a5f4f..b08d373d2 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -50,7 +50,7 @@ void ConnectMultiheadedTrains() if (u->IsMultiheaded()) { if (!u->IsEngine()) { /* we got a rear car without a front car. We will convert it to a front one */ - SetTrainEngine(u); + u->SetEngine(); u->spritenum--; } @@ -63,7 +63,7 @@ void ConnectMultiheadedTrains() /* we found a car to partner with this engine. Now we will make sure it face the right way */ if (w->IsEngine()) { - ClearTrainEngine(w); + w->ClearEngine(); w->spritenum++; } break; @@ -87,7 +87,7 @@ void ConnectMultiheadedTrains() u->other_multiheaded_part = w; } else { /* we got a front car and no rear cars. We will fake this one for forget that it should have been multiheaded */ - ClearMultiheaded(u); + u->ClearMultiheaded(); } } } @@ -106,42 +106,42 @@ void ConvertOldMultiheadToNew() FOR_ALL_TRAINS(t) { if (HasBit(t->subtype, 7) && ((t->subtype & ~0x80) == 0 || (t->subtype & ~0x80) == 4)) { - for (Vehicle *u = t; u != NULL; u = u->Next()) { + for (Train *u = t; u != NULL; u = u->Next()) { const RailVehicleInfo *rvi = RailVehInfo(u->engine_type); ClrBit(u->subtype, 7); switch (u->subtype) { case 0: // TS_Front_Engine - if (rvi->railveh_type == RAILVEH_MULTIHEAD) SetMultiheaded(u); - SetFrontEngine(u); - SetTrainEngine(u); + if (rvi->railveh_type == RAILVEH_MULTIHEAD) u->SetMultiheaded(); + u->SetFrontEngine(); + u->SetEngine(); break; case 1: // TS_Artic_Part u->subtype = 0; - SetArticulatedPart(u); + u->SetArticulatedPart(); break; case 2: // TS_Not_First u->subtype = 0; if (rvi->railveh_type == RAILVEH_WAGON) { /* normal wagon */ - SetTrainWagon(u); + u->SetWagon(); break; } if (rvi->railveh_type == RAILVEH_MULTIHEAD && rvi->image_index == u->spritenum - 1) { /* rear end of a multiheaded engine */ - SetMultiheaded(u); + u->SetMultiheaded(); break; } - if (rvi->railveh_type == RAILVEH_MULTIHEAD) SetMultiheaded(u); - SetTrainEngine(u); + if (rvi->railveh_type == RAILVEH_MULTIHEAD) u->SetMultiheaded(); + u->SetEngine(); break; case 4: // TS_Free_Car u->subtype = 0; - SetTrainWagon(u); - SetFreeWagon(u); + u->SetWagon(); + u->SetFreeWagon(); break; default: NOT_REACHED(); } |