summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-02-01 22:02:14 +0000
committerglx <glx@openttd.org>2008-02-01 22:02:14 +0000
commit525409b0fc2bf3668d2dc0228fc8d2e14a5e7a48 (patch)
tree85232d22f5526c6d36a56090c71361bfa9b43bb6 /src/aircraft_cmd.cpp
parent67782add1125d7c3209b02b3dde27e5ebb3be6d1 (diff)
downloadopenttd-525409b0fc2bf3668d2dc0228fc8d2e14a5e7a48.tar.xz
(svn r12037) -Codechange: replace OnNewDay_(Aircraft|RoadVeh|Ship|Train) with an OnNewDay method in the Vehicle class
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 1f5083e84..7df232fae 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -723,27 +723,27 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
}
}
-void OnNewDay_Aircraft(Vehicle *v)
+void Aircraft::OnNewDay()
{
- if (!IsNormalAircraft(v)) return;
+ if (!IsNormalAircraft(this)) return;
- if ((++v->day_counter & 7) == 0) DecreaseVehicleValue(v);
+ if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);
- CheckOrders(v);
+ CheckOrders(this);
- CheckVehicleBreakdown(v);
- AgeVehicle(v);
- CheckIfAircraftNeedsService(v);
+ CheckVehicleBreakdown(this);
+ AgeVehicle(this);
+ CheckIfAircraftNeedsService(this);
- if (v->vehstatus & VS_STOPPED) return;
+ if (this->vehstatus & VS_STOPPED) return;
- CommandCost cost = CommandCost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364);
+ CommandCost cost = CommandCost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(this, 0x0E, AircraftVehInfo(this->engine_type)->running_cost) * _price.aircraft_running / 364);
- v->profit_this_year -= cost.GetCost() >> 8;
+ this->profit_this_year -= cost.GetCost() >> 8;
- SubtractMoneyFromPlayerFract(v->owner, cost);
+ SubtractMoneyFromPlayerFract(this->owner, cost);
- InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
+ InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}