Changeset - r313:9c9b258ea6c5
[Not reviewed]
master
0 1 0
truelight - 20 years ago 2004-09-25 13:58:27
truelight@openttd.org
(svn r319) -Fix: [ 1029064 ] Building a station acted weird in some rare situations
1 file changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -764,7 +764,9 @@ int32 CmdBuildRailroadStation(int x_org,
 

	
 
	// Make sure the area below consists of clear tiles. (OR tiles belonging to a certain rail station)
 
	est = -1;
 
	if ((ret=CheckFlatLandBelow(tile_org, w_org, h_org, flags, 5 << direction, _patches.nonuniform_stations ? &est : NULL)) == CMD_ERROR) return CMD_ERROR;
 
	// If DC_EXEC is in flag, do not want to pass it to CheckFlatLandBelow, because of a nice bug
 
	//  for detail info, see: https://sourceforge.net/tracker/index.php?func=detail&aid=1029064&group_id=103924&atid=636365
 
	if ((ret=CheckFlatLandBelow(tile_org, w_org, h_org, flags&~DC_EXEC, 5 << direction, _patches.nonuniform_stations ? &est : NULL)) == CMD_ERROR) return CMD_ERROR;
 
	cost = ret + (numtracks * _price.train_station_track + _price.train_station_length) * plat_len;
 

	
 
	// Make sure there are no similar stations around us.
 
@@ -813,6 +815,11 @@ int32 CmdBuildRailroadStation(int x_org,
 
		byte *layout_ptr;
 
		uint station_index = st->index;
 

	
 
		// Now really clear the land below the station
 
		// It should never return CMD_ERROR.. but you never know ;)
 
		//  (a bit strange function name for it, but it really does clear the land, when DC_EXEC is in flags)
 
		if (CheckFlatLandBelow(tile_org, w_org, h_org, flags, 5 << direction, _patches.nonuniform_stations ? &est : NULL) == CMD_ERROR) return CMD_ERROR;
 

	
 
		st->train_tile = finalvalues[0];
 
		if (!st->facilities) st->xy = finalvalues[0];
 
		st->facilities |= FACIL_TRAIN;
0 comments (0 inline, 0 general)