summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-01-17 22:22:53 +0000
committerpeter1138 <peter1138@openttd.org>2009-01-17 22:22:53 +0000
commitdba9d60d3a284b5abf6e74eede782d193d32a5a2 (patch)
treee0b9c008819bb0e7d539fd88b494a100be4414a3 /src/ai
parentf92fbaa5484f19b6479484aa6a70382889ab4df2 (diff)
downloadopenttd-dba9d60d3a284b5abf6e74eede782d193d32a5a2.tar.xz
(svn r15133) -Fix: Crash if no NoAIs are present.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_instance.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index 5f95b7d60..8d57e6da8 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -247,7 +247,7 @@ void AIInstance::Died()
DEBUG(ai, 0, "The AI died unexpectedly.");
this->is_dead = true;
- this->engine->ReleaseObject(this->instance);
+ if (this->instance != NULL) this->engine->ReleaseObject(this->instance);
delete this->engine;
this->instance = NULL;
this->engine = NULL;