Mercurial > hg > openttd
comparison src/ai/ai_instance.cpp @ 10799:c8323cf9bb9d draft
(svn r15133) -Fix: Crash if no NoAIs are present.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sat, 17 Jan 2009 22:22:53 +0000 |
parents | e0371993d4fd |
children | 4b0aae0b22a8 |
comparison
equal
deleted
inserted
replaced
10798:9757d7251204 | 10799:c8323cf9bb9d |
---|---|
245 void AIInstance::Died() | 245 void AIInstance::Died() |
246 { | 246 { |
247 DEBUG(ai, 0, "The AI died unexpectedly."); | 247 DEBUG(ai, 0, "The AI died unexpectedly."); |
248 this->is_dead = true; | 248 this->is_dead = true; |
249 | 249 |
250 this->engine->ReleaseObject(this->instance); | 250 if (this->instance != NULL) this->engine->ReleaseObject(this->instance); |
251 delete this->engine; | 251 delete this->engine; |
252 this->instance = NULL; | 252 this->instance = NULL; |
253 this->engine = NULL; | 253 this->engine = NULL; |
254 } | 254 } |
255 | 255 |