TBTR: Fix crash and issues when using a no longer available engine type.
Show error messages when cloning a vehicle to a template or virtual vehicle fails. Handle failed clones gracefully. Bypass engine availability check when doing a template edit action. Show correct error message if template replacement fails for a non-money reason.
This commit is contained in:
@@ -161,7 +161,7 @@ public:
|
||||
this->vehicle_over = INVALID_VEHICLE;
|
||||
|
||||
if (to_edit) {
|
||||
DoCommandP(0, to_edit->index, 0, CMD_VIRTUAL_TRAIN_FROM_TEMPLATE_VEHICLE, CcSetVirtualTrain);
|
||||
DoCommandP(0, to_edit->index, 0, CMD_VIRTUAL_TRAIN_FROM_TEMPLATE_VEHICLE | CMD_MSG(STR_TMPL_CANT_CREATE), CcSetVirtualTrain);
|
||||
}
|
||||
|
||||
this->resize.step_height = 1;
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
}
|
||||
|
||||
// create a new one
|
||||
DoCommandP(0, v->index, 0, CMD_VIRTUAL_TRAIN_FROM_TRAIN, CcSetVirtualTrain);
|
||||
DoCommandP(0, v->index, 0, CMD_VIRTUAL_TRAIN_FROM_TRAIN | CMD_MSG(STR_TMPL_CANT_CREATE), CcSetVirtualTrain);
|
||||
this->ToggleWidgetLoweredState(TCW_CLONE);
|
||||
ResetObjectToPlace();
|
||||
this->SetDirty();
|
||||
|
Reference in New Issue
Block a user