Update to 14.0-RC2

This commit is contained in:
dP
2024-03-17 01:01:56 +07:00
parent 53ff9d1f9f
commit da761f41e2
164 changed files with 9303 additions and 5998 deletions

View File

@@ -1178,7 +1178,7 @@ static void NormaliseTrainHead(Train *head)
/* If we don't have a unit number yet, set one. */
if (head->unitnumber != 0) return;
head->unitnumber = GetFreeUnitNumber(VEH_TRAIN);
head->unitnumber = Company::Get(head->owner)->freeunits[head->type].UseID(GetFreeUnitNumber(VEH_TRAIN));
}
/**
@@ -1336,6 +1336,7 @@ CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID
}
/* Remove stuff not valid anymore for non-front engines. */
DeleteVehicleOrders(src);
Company::Get(src->owner)->freeunits[src->type].ReleaseID(src->unitnumber);
src->unitnumber = 0;
src->name.clear();
}
@@ -4185,6 +4186,8 @@ void Train::OnNewCalendarDay()
/** Economy day handler. */
void Train::OnNewEconomyDay()
{
EconomyAgeVehicle(this);
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);
if (this->IsFrontEngine()) {