summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-03-08 17:32:34 +0000
committerDarkvater <darkvater@openttd.org>2005-03-08 17:32:34 +0000
commit3e51317236336e41cc48a863a2197fb215426aeb (patch)
tree4ccbf75816ae0b6d8e823dc45732a66aa96d5756
parent9c7d3f7f67165f0e17ff24990145703fae8cfffd (diff)
downloadopenttd-3e51317236336e41cc48a863a2197fb215426aeb.tar.xz
(svn r1961) - Fix: [ 1158618 ] Segmentation fault when loading savegame, out of bounds array check.
-rw-r--r--station_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/station_cmd.c b/station_cmd.c
index bfce8d403..823cc13c5 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -2499,11 +2499,11 @@ static void UpdateStationRating(Station *st)
}
{
- if (!IS_HUMAN_PLAYER(st->owner) && st->owner != OWNER_NONE)
+ if (st->owner != OWNER_NONE && !IS_HUMAN_PLAYER(st->owner))
rating += _rating_boost[_opt.diff.competitor_intelligence];
}
- if (st->owner < 8 && HASBIT(st->town->statues, st->owner))
+ if (st->owner < MAX_PLAYERS && HASBIT(st->town->statues, st->owner))
rating += 26;
{