diff options
Diffstat (limited to 'src/waypoint.cpp')
-rw-r--r-- | src/waypoint.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp index 015ca8941..791822eda 100644 --- a/src/waypoint.cpp +++ b/src/waypoint.cpp @@ -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; } } |