diff options
author | rubidium <rubidium@openttd.org> | 2007-04-29 22:33:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-04-29 22:33:51 +0000 |
commit | ec9ac99d01c74f1cb63e8c934c8a13d8aca2422a (patch) | |
tree | 81c46786f55f9842ddb4b237507c86df8fd72924 /src/roadveh_cmd.cpp | |
parent | 202009522c3075e26b675ed0408075b8663b0859 (diff) | |
download | openttd-ec9ac99d01c74f1cb63e8c934c8a13d8aca2422a.tar.xz |
(svn r9755) -Codechange: refactor some more of the begin loading stuff.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 012233164..c6ca01265 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -486,10 +486,10 @@ int32 CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) } -static void MarkRoadVehDirty(Vehicle *v) +void RoadVehicle::MarkDirty() { - v->cur_image = GetRoadVehImage(v, v->direction); - MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1); + this->cur_image = GetRoadVehImage(this, this->direction); + MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1); } static void UpdateRoadVehDeltaXY(Vehicle *v) @@ -765,7 +765,7 @@ static void HandleRoadVehLoading(Vehicle *v) SET_EXPENSES_TYPE(EXPENSES_ROADVEH_INC); if (LoadUnloadVehicle(v, false)) { InvalidateWindow(WC_ROADVEH_LIST, v->owner); - MarkRoadVehDirty(v); + v->MarkDirty(); } return; } @@ -1598,15 +1598,8 @@ again: v->last_station_visited = GetStationIndex(v->tile); RoadVehArrivesAt(v, st); - v->BeginLoading(); - SET_EXPENSES_TYPE(EXPENSES_ROADVEH_INC); - if (LoadUnloadVehicle(v, true)) { - InvalidateWindow(WC_ROADVEH_LIST, v->owner); - MarkRoadVehDirty(v); - } - InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); return; } |