
    BUTLER et al. v. TIFTON, THOMASVILLE AND GULF RAILWAY COMPANY.
    1. The right of a railroad, company to contract for the location and maintenance of stations may be restricted by the fact that the public has an interest in the times and places for stoppage of trains to receive and discharge freight and passengers.
    2. There is no such restriction, on the company’s power to contract to build a spur-track from its main line to a sawmill or other private enterprise.
    8. The validity of such contract was recognized in. Bedgood v. Tifton Co., 116 Ga. 949, 951; and it was not error to overrule the demurrer.
    4. Instead of reducing an agreement to writing, the parties, by reference, may ■adopt the terms of-a contract already in writing.
    5. A party must be held bound by a ruling which he invoked, and by a judgment in his favor which he procured.
    6. If in a pending suit the plaintiff offers an amendment, and the defendant demurs thereto on the ground that “it sets up a new and distinct cause of action,” and such demurrer is sustained, the jüügmentt dismissing such suit will not bar the plaintiff from suing on the cause of action sefout in the amendment offered, but disallowed for the reason that it was a new and distinct cause of action.
    7. Such ruling on the demurrer further shows that the merits of the matter set out in the amendment were not, and could not have been, determined in the first suit.
    8. It was error to sustain the plea of res adjudicata.
    Argued December 17, 1904, —
    Decided January 28, 1905.
    Action for breach of contract. Before Judge Humphreys. City court of Moultrie. August 8, 1904.
    Many of the facts involved in the present case are stated in 116 Ga. 945. While the record is voluminous, the following is a synopsis of what is material to an understanding of the points involved in the decision. The Union Lumber Company owned .1617 acres of land in Colquitt county, the timber privileges on which it sold to Huber & Stokes. On October 24, 1899, this firm entered into a contract with the Tifton, Thomasville and Gulf Railway Company, by which, in consideration that they would locate their sawmill on the premises and ship all the lumber cut from this land over the railway company’s line, the latter agreed to build a side-track to the sawmill and to haul the timber therefrom at a rate as low as that charged other shippers. On November 3, 1899, Huber & Stokes sold the timber and assigned this contract to Bedgood & Co. The latter, on April 21,1902, brought an action against the railway company for damages for breach of the contract to build the side-track. The company’s demurrer to this petition w;as sustained by this court (116 Ga. 945), on the ground that the contract sued on was not assignable. On the return of the remittitur Bedgood' & Co. offered an amendment to the petition, setting up that a competitor of the defendant had a line of road near the timber described; that it was to the advantage of the defendant to enter into an agreement by which it would secure the freight from the sawmill instead of allowing it to go over the other road; that for this reason the contract in reference to the side-track was made; that prior to the purchase by Bedgood & Co. of the timber from Huber & Stokes, and before the payment of any purchase-money therefor, Bedgood & Co. informed the officers of the railway company that they were negotiating to acquire the timber, and desired to know whether the railway company \$uuld carry°out the contract arid put in the spur-track if the plaintiffs should purchase the timber and have transferred to them the contract aforesaid; that the railway officials notified Bedgood & Co. that the railway company would carry out the contract with plaintiffs should plaintiffs purchase, and did then and there assent to the transfer of said contract to plaintiffs, and on this assent being given, plaintiffs parted with $7,550 in the acquisition of the timber rights ¿foresaid; that in addition to the above-mentioned consideration plaintiffs agreed, as a part of the trade, to assume and carry out the obligations of Huber & Stokes under the contract aforesaid, that plaintiffs were financially responsible, and the railway company agreed for the contract to be transferred to plaintiffs and agreed and fully bound itself to carry out for plaintiffs all the terms of the contract as it had bound itself to do with Huber & Stokes, and never denied its obligation until about the time of the filing of this suit; that about March 1, 1900, the railway company insisted under the contract upon plaintiffs giving to it the output of the mill, and again stated to plaintiffs that if plaintiffs would haul, the cut of the mill to the main line, then the railway company would hasten the construction of the spur-track and put it in at once, and to this end had its engineer mark out the line; that though plaintiffs were not bound to ship said lumber over defendant’s line until the completion of the spur-track, yet, relying on the obligation aforesaid, they did, as requested by the railway company, ship the output of their mill over the road.
    To this amendment the defendant demurred upon several grounds; among others, that the amendment sought to add a new and distinct cause of action. After argument it was ordered and adjudged, “that the amendment offered by plaintiffs to said declaration be disallowed on the ground that the same sets up a new aud distinct cause of action.” Thereupon, on July 21, 1903, Bedgood & Co. brought a new suit, containing, among other things, all the allegations set forth in the foregoing amendment, and alleging the items of damage and the extra expense of hauling lumber to the main line, aggregating $6,511.91. To this second suit the railway company filed both a demurrer and a plea of res adjudicata. The demurrer was both general and special, and attacked the petition on many grounds, among others, that the contract was vague and indefinite; not assignable; without consideration; void under the statute of frauds; involved the title to land, of which the city court had no jurisdiction; contrary to public policy, being an undertaking by a quasi-public corporation to perform an unlimited amount of work during an unlimited time. There were also many other grounds of special demurrer which it is unnecessary to state in detail. The court overruled the demurrer, to which judgment the railway company by cross-bill excepted. The court sustained the plea of res ad judicata, to which was attached as an exhibit the original suit with the amendment and the judgment disallowing the amendment on the ground that it set up a new cause of action. To the sustaining of the plea of res adjudicata the plaintiffs excepted.
    
      Shipp & Kline, for plaintiffs.
    
      J. H. Merrill, J. L. Sweat, anff J. A. Wilkes, for defendant.
   Lamar, J.

(After stating the foregoing facts.) The public has an interest in the location of depots, and the time and place at which trains must stop for the reception of freight and passengers. A railroad company’s power to contract in reference thereto is therefore not unrestricted, but public policy must be considered in determining the legality of such agreements. See the cases cited in 7 Rap. & Mack’s R. Dig. 201-204. But such limitation on its power to contract does not apply to a case where the railroad company covenants to build a spur-track from its main line to a sawmill or other private enterprise. The interest of the public can not in any way be seriously affected by the construction and maintenance of such track. Austin v. Augusta Co., 108 Ga. 692, 693; Graham v. Macon R. Co., 120 Ga. 757 (3). Indeed the validity of such contract was recognized in Tifton Ry. Co. v. Bedgood, 116 Ga. 949, 951. The allegations of the petition then under review were so nearly identical with those in the present case that it is unnecessary further to consider the demurrer, which the court properly overruled.

In the case last cited this court held, that while the .contract bound the railroad company to build a spur-track for Huber & Stokes, it could not be assigned to Bedgood & Co. so- as to give the latter a right of action for its breach. On the return of the remittitur the plaintiffs offered to amend the petition by alleging that they not only had an assignment from Huber & Stokes, but^ that the railway company assented to the assignment, and agreed that if Bedgood & Co. would buy the laud, build the mill, and ship the lumber over its lines, it would build the spur-track. In other words, the amendment averred that there was an independent agreement between Bedgood & Co. and the railway company in reference to the building of the spur-track. Instead of reducing this agreement to writing, however, the parties adopted terms which were already in writing; and, by reference or otherwise, parties can adopt the terms of a contract between others. American Co. v. Continental Co., 188 U. S. 107; International Co. v. Hardy, 118 Ga. 512 ; compare Town of Douglasville v. Johns, 62 Ga. 427 (3).

The amendment therefore set out a cause of action. But the court held that it “ set up a new and distinct cause of action; ” that the original suit was on a contract between Huber & Stokes and the railway company, while the amendment sought to recover for an entirely different cause of action arising out of a contract between different parties. Yielding to that decision Bedgood & Co. thereupon brought the present action, making therein most of the allegations contained in the amendment which had been thus disallowed by the court. To this the railway company filed a plea of res adjudicata, and upon the production of the record in the former suit the plea was sustained. It is evident that Bedgood & Co. have not had a hearing on the merits, and that the matters set up in the present suit were not passed on in the former. Civil Code, §§ 50'95, 3744. It is further evident that the facts set out in the present case could not “ have been put in issue in the cause wherein the judgment was rendered.” Civil Code, § 3742. For when Bedgood & Co. endeavored to secure *a hearing on. the new matter, they were prevented from s.o doing by the order sustaining the company’s demurrer. Having secured a judgment sustaining their position, the railway company must be held bound by the ruling which it invoked, and.by the judgment in its favor which it secured. Brown v. State, 109 Ga. 571; Papworth v. Fitzgerald, 111 Ga. 55; Neal Co. v. Chastain, 121 Ga. 500. The very terms of the record offered in support of the plea of res adjudicata show that “the new cause” could not be barred by a judgment in an “ old ” and “ different cause ” — one so different that the new could not be added to it by way of amendment. This is not a second suit for the same cause of action, but a new suit for a distinct cause of action. That it is new and distinct from that formerly brought appears from the record attached to the plea. The case should not have been dismissed.

Judgment reversed.

All the Justices concur.  