train_cmd.c
changeset 2854 6b85a5f4b65f
parent 2844 7a55ad0a6a36
child 2855 950b5a56f9d5
equal deleted inserted replaced
2853:8d0c510a168b 2854:6b85a5f4b65f
   672 	Engine *e;
   672 	Engine *e;
   673 	TileIndex tile = TileVirtXY(x, y);
   673 	TileIndex tile = TileVirtXY(x, y);
   674 	uint num_vehicles;
   674 	uint num_vehicles;
   675 
   675 
   676 	/* Check if the engine-type is valid (for the player) */
   676 	/* Check if the engine-type is valid (for the player) */
   677 	if (!IsEngineBuildable(p1, VEH_Train)) return CMD_ERROR;
   677 	if (!IsEngineBuildable(p1, VEH_Train)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
   678 
   678 
   679 	/* Check if the train is actually being built in a depot belonging
   679 	/* Check if the train is actually being built in a depot belonging
   680 	 * to the player. Doesn't matter if only the cost is queried */
   680 	 * to the player. Doesn't matter if only the cost is queried */
   681 	if (!(flags & DC_QUERY_COST)) {
   681 	if (!(flags & DC_QUERY_COST)) {
   682 		if (!IsTileDepotType(tile, TRANSPORT_RAIL)) return CMD_ERROR;
   682 		if (!IsTileDepotType(tile, TRANSPORT_RAIL)) return CMD_ERROR;