TBTR: Fix refitting of template vehicles failing.
Fix from KeldorKatarn's tree.
This commit is contained in:
@@ -458,11 +458,6 @@ CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
|||||||
|
|
||||||
/* Allow auto-refitting only during loading and normal refitting only in a depot. */
|
/* Allow auto-refitting only during loading and normal refitting only in a depot. */
|
||||||
if (!is_virtual_train) {
|
if (!is_virtual_train) {
|
||||||
if (!free_wagon && (!auto_refit || !front->current_order.IsType(OT_LOADING)) && !front->IsStoppedInDepot()) {
|
|
||||||
return_cmd_error(STR_ERROR_TRAIN_MUST_BE_STOPPED_INSIDE_DEPOT + front->type);
|
|
||||||
}
|
|
||||||
if (front->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED);
|
|
||||||
}
|
|
||||||
if ((flags & DC_QUERY_COST) == 0 && // used by the refit GUI, including the order refit GUI.
|
if ((flags & DC_QUERY_COST) == 0 && // used by the refit GUI, including the order refit GUI.
|
||||||
!free_wagon && // used by autoreplace/renew
|
!free_wagon && // used by autoreplace/renew
|
||||||
(!auto_refit || !front->current_order.IsType(OT_LOADING)) && // refit inside stations
|
(!auto_refit || !front->current_order.IsType(OT_LOADING)) && // refit inside stations
|
||||||
@@ -471,6 +466,9 @@ CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (front->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED);
|
if (front->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (front->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED);
|
||||||
|
|
||||||
/* Check cargo */
|
/* Check cargo */
|
||||||
CargoID new_cid = GB(p2, 0, 5);
|
CargoID new_cid = GB(p2, 0, 5);
|
||||||
|
Reference in New Issue
Block a user