(svn r12346) -Fix [FS#1748, FS#1825](r9874, r11872): Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP.
/* $Id$ *//** @file waypoint.h */#ifndef WAYPOINT_H#define WAYPOINT_H#include"oldpool.h"#include"rail_map.h"#include"command_type.h"structWaypoint;DECLARE_OLD_POOL(Waypoint,Waypoint,3,8000)structWaypoint:PoolItem<Waypoint,WaypointID,&_Waypoint_pool>{TileIndexxy;///< Tile of waypointTownIDtown_index;///< Town associated with the waypointuint16town_cn;///< The Nth waypoint for this town (consecutive number)StringIDstring;///< C000-C03F have special meaning in old gameschar*name;///< Custom name. If not set, town + town_cn is used for namingViewportSignsign;///< Dimensions of sign (not saved)Datebuild_date;///< Date of constructionbytestat_id;///< ID of waypoint within the waypoint class (not saved)uint32grfid;///< ID of GRF filebytelocalidx;///< Index of station within GRF filebytedeleted;///< Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is deleted.Waypoint(TileIndextile=0);~Waypoint();inlineboolIsValid()const{returnthis->xy!=0;}};staticinlineboolIsValidWaypointID(WaypointIDindex){returnindex<GetWaypointPoolSize()&&GetWaypoint(index)->IsValid();}staticinlinevoidDeleteWaypoint(Waypoint*wp){wp->~Waypoint();}#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1U < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1U) : NULL) if (wp->IsValid())#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)/** * Fetch a waypoint by tile * @param tile Tile of waypoint * @return Waypoint */staticinlineWaypoint*GetWaypointByTile(TileIndextile){assert(IsTileType(tile,MP_RAILWAY)&&IsRailWaypoint(tile));returnGetWaypoint(GetWaypointIndex(tile));}CommandCostRemoveTrainWaypoint(TileIndextile,uint32flags,booljustremove);Station*ComposeWaypointStation(TileIndextile);voidShowRenameWaypointWindow(constWaypoint*cp);voidDrawWaypointSprite(intx,inty,intstat_id,RailTyperailtype);voidFixOldWaypoints();voidUpdateAllWaypointSigns();voidAfterLoadWaypoints();#endif /* WAYPOINT_H */