(svn r16860) -Codechange: introduce a helper to assign a station spec to Waypoints
This commit is contained in:
@@ -91,6 +91,25 @@ Waypoint::~Waypoint()
|
||||
this->sign.MarkDirty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a station spec to this waypoint.
|
||||
* @param index the index of the spec from the waypoint specs
|
||||
*/
|
||||
void Waypoint::AssignStationSpec(uint index)
|
||||
{
|
||||
const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, index);
|
||||
|
||||
if (statspec != NULL) {
|
||||
this->spec.spec = statspec;
|
||||
this->spec.grfid = statspec->grffile->grfid;
|
||||
this->spec.localidx = statspec->localidx;
|
||||
} else {
|
||||
this->spec.spec = NULL;
|
||||
this->spec.grfid = 0;
|
||||
this->spec.localidx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeWaypoints()
|
||||
{
|
||||
_waypoint_pool.CleanPool();
|
||||
|
Reference in New Issue
Block a user