summaryrefslogtreecommitdiff
path: root/ai_new.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-20 16:17:13 +0000
committertruelight <truelight@openttd.org>2004-08-20 16:17:13 +0000
commitb43e1e4e4301eb7df7162c2137f4a7698712423e (patch)
treefac00c95ba59d0d492cec36e89047870489d1247 /ai_new.c
parentc55eda92f8c959d1c35367b06b1d23f425884afa (diff)
downloadopenttd-b43e1e4e4301eb7df7162c2137f4a7698712423e.tar.xz
(svn r94) -Fix: AI crash bug (blathijs)
Diffstat (limited to 'ai_new.c')
-rw-r--r--ai_new.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ai_new.c b/ai_new.c
index 1a79a50bf..df4cad4b7 100644
--- a/ai_new.c
+++ b/ai_new.c
@@ -487,12 +487,13 @@ static bool AiNew_CheckVehicleStation(Player *p, Station *st) {
FOR_ALL_VEHICLES(v) {
if (v->owner == _current_player) {
sched = v->schedule_ptr;
+ if (sched == NULL) continue;
while ((ord=*sched++) != 0) {
if ((ord & OT_MASK) == OT_GOTO_STATION && DEREF_STATION(ord >> 8) == st) {
// This vehicle has this city in his list
count++;
}
- };
+ }
}
}