(svn r16862) -Codechange: make waypoints use the same system of station station spec lists.

This commit is contained in:
rubidium
2009-07-17 20:40:29 +00:00
parent 72d6c3a9ad
commit c9cab7ba19
4 changed files with 35 additions and 17 deletions

View File

@@ -97,16 +97,19 @@ Waypoint::~Waypoint()
*/
void Waypoint::AssignStationSpec(uint index)
{
free(this->speclist);
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;
this->speclist = MallocT<StationSpecList>(1);
this->speclist->spec = statspec;
this->speclist->grfid = statspec->grffile->grfid;
this->speclist->localidx = statspec->localidx;
this->num_specs = 1;
} else {
this->spec.spec = NULL;
this->spec.grfid = 0;
this->spec.localidx = 0;
this->speclist = NULL;
this->num_specs = 0;
}
}