summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp15
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;
}