diff options
author | KUDr <kudr@openttd.org> | 2006-06-01 22:20:40 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-06-01 22:20:40 +0000 |
commit | d680fcec772d422b88ea4802add2e6195c6327a2 (patch) | |
tree | 0241149fb8567a25bc526c43c20c9412991a125d /yapf | |
parent | bd25f49d3f5252ba473759320b86f581be9c79fd (diff) | |
download | openttd-d680fcec772d422b88ea4802add2e6195c6327a2.tar.xz |
(svn r5067) -Codechange: [YAPF] Platform selection feature now applies penalty per platform instead of per tile (should give better results)
Diffstat (limited to 'yapf')
-rw-r--r-- | yapf/yapf_costrail.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yapf/yapf_costrail.hpp b/yapf/yapf_costrail.hpp index 76af3652b..ab708410d 100644 --- a/yapf/yapf_costrail.hpp +++ b/yapf/yapf_costrail.hpp @@ -148,10 +148,10 @@ public: int needed_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE; if (platform_length > needed_platform_length) { // apply penalty for longer platform than needed - cost += Yapf().PfGetSettings().rail_longer_platform_penalty * (platform_length - needed_platform_length); - } else { + cost += Yapf().PfGetSettings().rail_longer_platform_penalty; + } else if (needed_platform_length > platform_length) { // apply penalty for shorter platform than needed - cost += Yapf().PfGetSettings().rail_shorter_platform_penalty * (needed_platform_length - platform_length); + cost += Yapf().PfGetSettings().rail_shorter_platform_penalty; } return cost; } |