waypoint.c
changeset 4000 4009d092b306
parent 3977 513433ebd092
child 4051 22af4bcffbbb
equal deleted inserted replaced
3999:69dfaadb5c3c 4000:4009d092b306
   215 	if (flags & DC_EXEC) {
   215 	if (flags & DC_EXEC) {
   216 		const StationSpec *statspec = NULL;
   216 		const StationSpec *statspec = NULL;
   217 		MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index);
   217 		MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index);
   218 		MarkTileDirtyByTile(tile);
   218 		MarkTileDirtyByTile(tile);
   219 
   219 
   220 		if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP))
   220 		if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP)) {
   221 			statspec = GetCustomStationSpec(STAT_CLASS_WAYP, GB(p1, 0, 8));
   221 			statspec = GetCustomStationSpec(STAT_CLASS_WAYP, GB(p1, 0, 8));
       
   222 		}
   222 
   223 
   223 		if (statspec != NULL) {
   224 		if (statspec != NULL) {
   224 			SetCustomWaypointSprite(tile);
   225 			SetCustomWaypointSprite(tile);
   225 			wp->stat_id = GB(p1, 0, 8);
   226 			wp->stat_id = GB(p1, 0, 8);
   226 			wp->grfid = statspec->grfid;
   227 			wp->grfid = statspec->grfid;
   235 
   236 
   236 		wp->deleted = 0;
   237 		wp->deleted = 0;
   237 		wp->xy = tile;
   238 		wp->xy = tile;
   238 		wp->build_date = _date;
   239 		wp->build_date = _date;
   239 
   240 
   240 		if (wp->town_index == 0)
   241 		if (wp->town_index == 0) MakeDefaultWaypointName(wp);
   241 			MakeDefaultWaypointName(wp);
       
   242 
   242 
   243 		UpdateWaypointSign(wp);
   243 		UpdateWaypointSign(wp);
   244 		RedrawWaypointSign(wp);
   244 		RedrawWaypointSign(wp);
   245 	}
   245 	}
   246 
   246