src/rail_cmd.cpp
changeset 9867 f5d0c061f048
parent 9866 c99f3ec0b91f
child 9949 392998225bdd
equal deleted inserted replaced
9866:c99f3ec0b91f 9867:f5d0c061f048
  1052 	if (CmdFailed(ValidateAutoDrag(&trackdir, tile, end_tile))) return CMD_ERROR;
  1052 	if (CmdFailed(ValidateAutoDrag(&trackdir, tile, end_tile))) return CMD_ERROR;
  1053 
  1053 
  1054 	track = TrackdirToTrack(trackdir); /* trackdir might have changed, keep track in sync */
  1054 	track = TrackdirToTrack(trackdir); /* trackdir might have changed, keep track in sync */
  1055 	Trackdir start_trackdir = trackdir;
  1055 	Trackdir start_trackdir = trackdir;
  1056 
  1056 
  1057 	/* Autofill must start on a valid track to be able to avoid loops */
  1057 	/* Must start on a valid track to be able to avoid loops */
  1058 	if (autofill && !HasTrack(tile, track)) return CMD_ERROR;
  1058 	if (!HasTrack(tile, track)) return CMD_ERROR;
  1059 
  1059 
  1060 	SignalType sigtype = (SignalType)GB(p2, 7, 3);
  1060 	SignalType sigtype = (SignalType)GB(p2, 7, 3);
  1061 	if (sigtype > SIGTYPE_LAST) return CMD_ERROR;
  1061 	if (sigtype > SIGTYPE_LAST) return CMD_ERROR;
  1062 
  1062 
  1063 	/* copy the signal-style of the first rail-piece if existing */
  1063 	/* copy the signal-style of the first rail-piece if existing */