summaryrefslogtreecommitdiff
path: root/src/waypoint.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-17 20:40:29 +0000
committerrubidium <rubidium@openttd.org>2009-07-17 20:40:29 +0000
commitc9cab7ba1967a42b90b44bca865db33c66a20c72 (patch)
treedd85a92a79169b853a364910d8c2d3cd497caadb /src/waypoint.cpp
parent72d6c3a9ad5013555607b7f90f1f0f9dd5faba0b (diff)
downloadopenttd-c9cab7ba1967a42b90b44bca865db33c66a20c72.tar.xz
(svn r16862) -Codechange: make waypoints use the same system of station station spec lists.
Diffstat (limited to 'src/waypoint.cpp')
-rw-r--r--src/waypoint.cpp15
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;
}
}