From d680fcec772d422b88ea4802add2e6195c6327a2 Mon Sep 17 00:00:00 2001 From: KUDr Date: Thu, 1 Jun 2006 22:20:40 +0000 Subject: (svn r5067) -Codechange: [YAPF] Platform selection feature now applies penalty per platform instead of per tile (should give better results) --- yapf/yapf_costrail.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'yapf/yapf_costrail.hpp') 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; } -- cgit v1.2.3-70-g09d2