diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index add24d9..3ecaa52 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -31,6 +31,7 @@
 #include "company_func.h"
 #include "station_base.h"
 #include "zoom_func.h"
+#include "infrastructure_func.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
@@ -890,7 +891,8 @@ class SmallMapWindow : public Window {
 
 		const Station *st;
 		FOR_ALL_STATIONS(st) {
-			if (st->owner != _local_company && Company::IsValidID(st->owner)) continue;
+            // XXX: hardcoded for trains...
+            if (Company::IsValidID(st->owner) && !CheckInfraUsageAllowed(st->owner, VEH_TRAIN)) continue;
 
 			Point pt = GetStationMiddle(st);
 
@@ -1001,7 +1003,8 @@ class SmallMapWindow : public Window {
 
 			const Station * sta;
 			FOR_ALL_STATIONS(sta) {
-				if (sta->owner != _local_company && Company::IsValidID(sta->owner)) continue;
+                // XXX: hardcoded for trains...
+                if (Company::IsValidID(sta->owner) && !CheckInfraUsageAllowed(sta->owner, VEH_TRAIN)) continue;
 				for (int i = 0; i < _smallmap_cargo_count; ++i) {
 					const LegendAndColour &tbl = _legend_table[window->map_type][i];
 					if (!tbl.show_on_map) continue;
@@ -1014,7 +1017,8 @@ class SmallMapWindow : public Window {
 						if (Station::IsValidID(to) && seen_stations.find(to) == seen_stations.end()) {
 							const Station *stb = Station::Get(to);
 
-							if (stb->owner != _local_company && Company::IsValidID(stb->owner)) continue;
+                            // XXX: hardcoded for trains...
+                            if (Company::IsValidID(stb->owner) && !CheckInfraUsageAllowed(stb->owner, VEH_TRAIN)) continue;
 							if (seen_links.find(std::make_pair(to, from)) != seen_links.end()) continue;
 
 							DrawForwBackLinks(sta->index, stb->index);
