Changeset - r5679:51a01e1303ac
[Not reviewed]
master
0 1 0
KUDr - 17 years ago 2007-01-14 23:43:59
kudr@openttd.org
(svn r8139) -Cleanup: simplify auto_ptr initialization (Tron)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1777,25 +1777,25 @@ int32 CmdBuildBuoy(TileIndex tile, uint3
 
{
 
	Station *st;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 

	
 
	if (!IsClearWaterTile(tile) || tile == 0) return_cmd_error(STR_304B_SITE_UNSUITABLE);
 

	
 
	/* allocate and initialize new station */
 
	st = new Station(tile);
 
	if (st == NULL) return CMD_ERROR;
 

	
 
	/* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */
 
	std::auto_ptr<Station> st_auto_delete = std::auto_ptr<Station>(st);
 
	std::auto_ptr<Station> st_auto_delete(st);
 

	
 
	st->town = ClosestTownFromTile(tile, (uint)-1);
 
	st->sign.width_1 = 0;
 

	
 
	if (!GenerateStationName(st, tile, 4)) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		st->dock_tile = tile;
 
		st->facilities |= FACIL_DOCK;
 
		/* Buoys are marked in the Station struct by this flag. Yes, it is this
 
		 * braindead.. */
 
		st->had_vehicle_of_type |= HVOT_BUOY;
0 comments (0 inline, 0 general)