summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-08-19 20:54:15 +0000
committerplanetmaker <planetmaker@openttd.org>2011-08-19 20:54:15 +0000
commit4b3aa9f26e02d3df23ec5cec5fe4a2d07f6de139 (patch)
tree58aaedaac5d7869a6ed9d28fa686c0f676de4c22 /src
parentf1b792cd0121181484218467c76d5a9869621d8c (diff)
downloadopenttd-4b3aa9f26e02d3df23ec5cec5fe4a2d07f6de139.tar.xz
(svn r22761) -Fix (r22708): Make invisible signs un-clickable (Zuu)
Diffstat (limited to 'src')
-rw-r--r--src/viewport.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 800d2d359..d118df534 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1833,6 +1833,9 @@ static bool CheckClickOnStation(const ViewPort *vp, int x, int y)
/* Don't check if the display options are disabled */
if (!HasBit(_display_opt, is_station ? DO_SHOW_STATION_NAMES : DO_SHOW_WAYPOINT_NAMES)) continue;
+ /* Don't check if competitor signs are not shown and the sign isn't owned by the local company */
+ if (!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS) && _local_company != st->owner && st->owner != OWNER_NONE) continue;
+
if (CheckClickOnViewportSign(vp, x, y, &st->sign)) {
if (is_station) {
ShowStationViewWindow(st->index);
@@ -1854,6 +1857,9 @@ static bool CheckClickOnSign(const ViewPort *vp, int x, int y)
const Sign *si;
FOR_ALL_SIGNS(si) {
+ /* If competitor signs are hidden, don't check signs that aren't owned by local company */
+ if (!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS) && _local_company != si->owner) continue;
+
if (CheckClickOnViewportSign(vp, x, y, &si->sign)) {
HandleClickOnSign(si);
return true;