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 */
|
/* repair cost is value for new vehicles and each week +/256 part for old */
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (!v->IsPrimaryVehicle()) continue;
|
if (!v->IsPrimaryVehicle()) continue;
|
||||||
|
|
||||||
v->repair_cost = v->value;
|
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",
|
//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 );
|
// v->engine_type, (int64)v->value, v->age, v->max_age, (int64)v->repair_cost );
|
||||||
|
|
||||||
if ( v->age > v->max_age ) {
|
if (v->age > v->max_age) {
|
||||||
Date weeks = (v->age - v->max_age)/7;
|
Date weeks = (v->age - v->max_age) / 7;
|
||||||
for(int w = 0; w < weeks; w++, v->repair_cost += v->repair_cost >> 8 );
|
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 );
|
//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 {
|
do {
|
||||||
v->date_of_last_service = _date;
|
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;
|
ExpensesType type = INVALID_EXPENSES;
|
||||||
_current_company = v->owner;
|
_current_company = v->owner;
|
||||||
switch (v->type) {
|
switch (v->type) {
|
||||||
case VEH_AIRCRAFT:
|
case VEH_AIRCRAFT:
|
||||||
type = EXPENSES_AIRCRAFT_RUN;
|
type = EXPENSES_AIRCRAFT_RUN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VEH_TRAIN:
|
case VEH_TRAIN:
|
||||||
type = EXPENSES_TRAIN_RUN;
|
type = EXPENSES_TRAIN_RUN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VEH_SHIP:
|
case VEH_SHIP:
|
||||||
type = EXPENSES_SHIP_RUN;
|
type = EXPENSES_SHIP_RUN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VEH_ROAD:
|
case VEH_ROAD:
|
||||||
type = EXPENSES_ROADVEH_RUN;
|
type = EXPENSES_ROADVEH_RUN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
NOT_REACHED();
|
NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user