diff options
author | fonsinchen <fonsinchen@openttd.org> | 2014-06-14 13:35:39 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2014-06-14 13:35:39 +0000 |
commit | 957f5ca11758d556763881d04ced39cd34c470c1 (patch) | |
tree | 03a1c5061a2d4466526f39b637a0967333a5591f /src/linkgraph/demands.cpp | |
parent | e8e5cdde034dcf5c3874790b5a9cd67ad300ee9d (diff) | |
download | openttd-957f5ca11758d556763881d04ced39cd34c470c1.tar.xz |
(svn r26646) -Fix [FS#6041]: Save locations instead of distances in link graphs to reduce size.
Diffstat (limited to 'src/linkgraph/demands.cpp')
-rw-r--r-- | src/linkgraph/demands.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/linkgraph/demands.cpp b/src/linkgraph/demands.cpp index c16288123..2c88778ab 100644 --- a/src/linkgraph/demands.cpp +++ b/src/linkgraph/demands.cpp @@ -210,7 +210,8 @@ void DemandCalculator::CalcDemand(LinkGraphJob &job, Tscaler scaler) /* Scale the distance by mod_dist around max_distance */ int32 distance = this->max_distance - (this->max_distance - - (int32)job[from_id][to_id].Distance()) * this->mod_dist / 100; + (int32)DistanceMaxPlusManhattan(job[from_id].XY(), job[to_id].XY())) * + this->mod_dist / 100; /* Scale the accuracy by distance around accuracy / 2 */ int32 divisor = this->accuracy * (this->mod_dist - 50) / 100 + |