summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/station_cmd.c b/station_cmd.c
index d2f8288a5..21c98a9e4 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -2548,7 +2548,7 @@ void OnTick_Station(void)
if (_game_mode == GM_EDITOR) return;
i = _station_tick_ctr;
- if (++_station_tick_ctr == GetStationArraySize()) _station_tick_ctr = 0;
+ if (++_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
if (IsValidStationID(i)) StationHandleBigTick(GetStation(i));
@@ -3098,7 +3098,7 @@ static void Load_STNS(void)
}
/* This is to ensure all pointers are within the limits of _stations_size */
- if (_station_tick_ctr > GetStationArraySize()) _station_tick_ctr = 0;
+ if (_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
}
static void Save_ROADSTOP(void)