diff options
author | rubidium <rubidium@openttd.org> | 2007-04-29 18:21:24 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-04-29 18:21:24 +0000 |
commit | dba21ab802a21588ee6d03c202b1c809b06f9982 (patch) | |
tree | 87b202dc9547deba8ff9f14dc895001e6404777e /src/vehicle.cpp | |
parent | 1f627254c36a643afc0da593116f3352d078bdf9 (diff) | |
download | openttd-dba21ab802a21588ee6d03c202b1c809b06f9982.tar.xz |
(svn r9752) -Codechange: remove some duplication related to BeginLoading.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 90ee45ad6..dccebcd5d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2950,6 +2950,24 @@ extern const ChunkHandler _veh_chunk_handlers[] = { void Vehicle::BeginLoading() { assert(IsTileType(tile, MP_STATION) || type == VEH_SHIP); + + if (this->current_order.type == OT_GOTO_STATION && + this->current_order.dest == this->last_station_visited) { + /* Arriving at the ordered station. + * Keep the load/unload flags, as we (obviously) still need them. */ + this->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER; + + /* Furthermore add the Non Stop flag to mark that this station + * is the actual destination of the vehicle, which is (for example) + * necessary to be known for HandleTrainLoading to determine + * whether the train is lost or not; not marking a train lost + * that arrives at random stations is bad. */ + this->current_order.flags |= OF_NON_STOP; + } else { + /* This is just an unordered intermediate stop */ + this->current_order.flags = 0; + } + current_order.type = OT_LOADING; GetStation(this->last_station_visited)->loading_vehicles.push_back(this); } |