forked from mirror/OpenTTD
(svn r19657) -Fix: Add saneness checks for front vehicles.
This commit is contained in:
@@ -410,7 +410,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||
uint32 build_argument = 2;
|
||||
|
||||
Vehicle *v = Vehicle::GetIfValid(p1);
|
||||
if (v == NULL) return CMD_ERROR;
|
||||
if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
||||
Vehicle *v_front = v;
|
||||
Vehicle *w = NULL;
|
||||
Vehicle *w_front = NULL;
|
||||
@@ -629,7 +629,7 @@ CommandCost SendAllVehiclesToDepot(VehicleType type, DoCommandFlag flags, bool s
|
||||
CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
{
|
||||
Vehicle *v = Vehicle::GetIfValid(p1);
|
||||
if (v == NULL) return CMD_ERROR;
|
||||
if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
||||
|
||||
CommandCost ret = CheckOwnership(v->owner);
|
||||
if (ret.Failed()) return ret;
|
||||
@@ -663,7 +663,7 @@ CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
CommandCost CmdChangeServiceInt(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
{
|
||||
Vehicle *v = Vehicle::GetIfValid(p1);
|
||||
if (v == NULL) return CMD_ERROR;
|
||||
if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
||||
|
||||
CommandCost ret = CheckOwnership(v->owner);
|
||||
if (ret.Failed()) return ret;
|
||||
|
Reference in New Issue
Block a user