1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

(svn r9808) -Codechange: unify the Handle<VehicleType>Loading functions.

This commit is contained in:
rubidium
2007-05-07 16:21:34 +00:00
parent 161786e222
commit 2efecd34c4
6 changed files with 45 additions and 109 deletions

View File

@@ -753,31 +753,6 @@ static void ProcessRoadVehOrder(Vehicle *v)
InvalidateVehicleOrder(v);
}
static void HandleRoadVehLoading(Vehicle *v)
{
switch (v->current_order.type) {
case OT_LOADING: {
Order b;
if (--v->load_unload_time_rem != 0) return;
if (LoadUnloadVehicle(v)) return;
b = v->current_order;
v->LeaveStation();
if (!(b.flags & OF_NON_STOP)) return;
break;
}
case OT_DUMMY: break;
default: return;
}
v->cur_order_index++;
InvalidateVehicleOrder(v);
}
static void StartRoadVehSound(const Vehicle* v)
{
if (!PlayVehicleSound(v, VSE_START)) {
@@ -1304,7 +1279,7 @@ static void RoadVehController(Vehicle *v)
if (v->vehstatus & VS_STOPPED) return;
ProcessRoadVehOrder(v);
HandleRoadVehLoading(v);
v->HandleLoading();
if (v->current_order.type == OT_LOADING) return;