diff options
author | rubidium <rubidium@openttd.org> | 2007-08-30 13:09:44 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-30 13:09:44 +0000 |
commit | 9b65bc430cc4e59cba2e7ad09c2fcc0448e22781 (patch) | |
tree | 6e679af8466e541ec086d1aba2cb7f6f89e4ad69 /src/aircraft_cmd.cpp | |
parent | cb7eaff3534c1d18c9c8bc06be04ceb437d97765 (diff) | |
download | openttd-9b65bc430cc4e59cba2e7ad09c2fcc0448e22781.tar.xz |
(svn r11004) -Codechange: some reworks of the saveload mechanism to be able to save and load private and protected variables in the vehicle struct.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 24c2a6110..4f6098d79 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -405,7 +405,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) v->u.air.state = HANGAR; v->u.air.previous_pos = v->u.air.pos; v->u.air.targetairport = GetStationIndex(tile); - v->next = u; + v->SetNext(u); v->service_interval = _patches.servint_aircraft; @@ -429,8 +429,6 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (v->subtype == AIR_HELICOPTER) { Vehicle *w = vl[2]; - u->next = w; - w = new (w) Aircraft(); w->direction = DIR_N; w->owner = _current_player; @@ -445,6 +443,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) /* Use rotor's air.state to store the rotor animation frame */ w->u.air.state = HRS_ROTOR_STOPPED; w->UpdateDeltaXY(INVALID_DIR); + + u->SetNext(w); VehiclePositionChanged(w); } |