summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-12-07 21:16:38 +0000
committerglx <glx@openttd.org>2007-12-07 21:16:38 +0000
commit8aaa4e7da64ee3762fdccb69204d383c221c1826 (patch)
tree77c019ee09c06cd40f931be3ad751b6d4b85b4d3 /src
parentcbb2d39860a847687019ab47095646e593fb5bc8 (diff)
downloadopenttd-8aaa4e7da64ee3762fdccb69204d383c221c1826.tar.xz
(svn r11590) -Fix (r11193): IsSlopeRefused() result was half wrong
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index ca920aabc..84a321757 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1184,14 +1184,14 @@ bool IsSlopeRefused(Slope current, Slope refused)
{
if (IsSteepSlope(current)) return true;
if (current != SLOPE_FLAT) {
- if (refused & SLOPE_STEEP) return true;
+ if (IsSteepSlope(refused)) return true;
Slope t = ComplementSlope(current);
- if (refused & 1 && (t & SLOPE_NW)) return false;
- if (refused & 2 && (t & SLOPE_NE)) return false;
- if (refused & 4 && (t & SLOPE_SW)) return false;
- if (refused & 8 && (t & SLOPE_SE)) return false;
+ if (refused & SLOPE_W && (t & SLOPE_NW)) return true;
+ if (refused & SLOPE_S && (t & SLOPE_NE)) return true;
+ if (refused & SLOPE_E && (t & SLOPE_SW)) return true;
+ if (refused & SLOPE_N && (t & SLOPE_SE)) return true;
}
return false;