Initial implementation of tracerestrict speed restriction feature

This commit is contained in:
Jonathan G Rennison
2019-12-05 18:34:05 +00:00
parent 030e8bf762
commit aa8aae9a62
14 changed files with 182 additions and 6 deletions

View File

@@ -385,6 +385,7 @@ CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head, DoComma
ChangeVehicleNews(old_head->index, new_head->index);
if (old_head->type == VEH_TRAIN) {
Train::From(new_head)->speed_restriction = Train::From(old_head)->speed_restriction;
/* Transfer any acquired trace restrict slots to the new vehicle */
if (HasBit(Train::From(old_head)->flags, VRF_HAVE_SLOT)) {
TraceRestrictTransferVehicleOccupantInAllSlots(old_head->index, new_head->index);