Vehicle repair costs patch: whitespace fixes.
This commit is contained in:
@@ -365,19 +365,19 @@ void AfterLoadVehicles(bool part_of_load)
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsSavegameVersionBefore( SL_REPAIRCOST )) {
|
||||
if (IsSavegameVersionBefore(SL_REPAIRCOST)) {
|
||||
/* repair cost is value for new vehicles and each week +/256 part for old */
|
||||
FOR_ALL_VEHICLES(v) {
|
||||
if (!v->IsPrimaryVehicle()) continue;
|
||||
|
||||
v->repair_cost = v->value;
|
||||
for(int w = 0; w < v->age / 7; w++, v->repair_cost += v->repair_cost >> 8 );
|
||||
for (int w = 0; w < v->age / 7; w++, v->repair_cost += v->repair_cost >> 8);
|
||||
//DEBUG(misc,0, "eid#%d, value=%lld, weeks=%d/%d, repair cost=%lld",
|
||||
// v->engine_type, (int64)v->value, v->age, v->max_age, (int64)v->repair_cost );
|
||||
|
||||
if ( v->age > v->max_age ) {
|
||||
Date weeks = (v->age - v->max_age)/7;
|
||||
for(int w = 0; w < weeks; w++, v->repair_cost += v->repair_cost >> 8 );
|
||||
if (v->age > v->max_age) {
|
||||
Date weeks = (v->age - v->max_age) / 7;
|
||||
for (int w = 0; w < weeks; w++, v->repair_cost += v->repair_cost >> 8);
|
||||
//DEBUG(misc,0, "OLD: value=%lld, weeks=%d, repair cost=%lld", (int64)v->value, weeks, (int64)v->repair_cost );
|
||||
}
|
||||
}
|
||||
|
@@ -99,22 +99,26 @@ void VehicleServiceInDepot(Vehicle *v)
|
||||
|
||||
do {
|
||||
v->date_of_last_service = _date;
|
||||
if ( _settings_game.vehicle.pay_for_repair && v->breakdowns_since_last_service ) {
|
||||
if (_settings_game.vehicle.pay_for_repair && v->breakdowns_since_last_service) {
|
||||
ExpensesType type = INVALID_EXPENSES;
|
||||
_current_company = v->owner;
|
||||
switch (v->type) {
|
||||
case VEH_AIRCRAFT:
|
||||
type = EXPENSES_AIRCRAFT_RUN;
|
||||
break;
|
||||
|
||||
case VEH_TRAIN:
|
||||
type = EXPENSES_TRAIN_RUN;
|
||||
break;
|
||||
|
||||
case VEH_SHIP:
|
||||
type = EXPENSES_SHIP_RUN;
|
||||
break;
|
||||
|
||||
case VEH_ROAD:
|
||||
type = EXPENSES_ROADVEH_RUN;
|
||||
break;
|
||||
|
||||
default:
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
Reference in New Issue
Block a user