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:
Jonathan G Rennison
2016-02-15 02:31:26 +00:00
parent d9a48a2b5e
commit 5850bcf699
8 changed files with 71 additions and 40 deletions

View File

@@ -478,7 +478,7 @@ public:
virtual bool OnVehicleSelect(const Vehicle *v)
{
bool succeeded = DoCommandP(0, v->index, 0, CMD_CLONE_TEMPLATE_VEHICLE_FROM_TRAIN, NULL);
bool succeeded = DoCommandP(0, v->index, 0, CMD_CLONE_TEMPLATE_VEHICLE_FROM_TRAIN | CMD_MSG(STR_TMPL_CANT_CREATE), NULL);
if (!succeeded) return false;