summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-11-30 16:10:19 +0000
committertruelight <truelight@openttd.org>2005-11-30 16:10:19 +0000
commit480b1575fe5cb677ff2ba1ee183e75863c545ed4 (patch)
tree169fc1a2826fa01fbcf4fb79867cd28b4d5765d0
parent6ed22fb3d41724a59b28f64fea406b2eb8cedd40 (diff)
downloadopenttd-480b1575fe5cb677ff2ba1ee183e75863c545ed4.tar.xz
(svn r3250) -Fix: AIs weren't uninitialized when a new game was loaded
-rw-r--r--ai/ai.c3
-rw-r--r--misc.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/ai/ai.c b/ai/ai.c
index 516a86cc6..c186d8051 100644
--- a/ai/ai.c
+++ b/ai/ai.c
@@ -309,6 +309,9 @@ void AI_Initialize(void)
char *tmp_ai_gpmi_param = strdup(_ai.gpmi_param);
#endif /* GPMI */
+ /* First, make sure all AIs are DEAD! */
+ AI_Uninitialize();
+
memset(&_ai, 0, sizeof(_ai));
memset(&_ai_player, 0, sizeof(_ai_player));
diff --git a/misc.c b/misc.c
index 36c9deae3..1e2993a21 100644
--- a/misc.c
+++ b/misc.c
@@ -18,6 +18,7 @@
#include "engine.h"
#include "vehicle_gui.h"
#include "variables.h"
+#include "ai/ai.h"
extern void StartupEconomy(void);
@@ -167,6 +168,7 @@ void InitializeGame(uint size_x, uint size_y)
InitializeTrains();
InitializeNPF();
+ AI_Initialize();
InitializePlayers();
InitializeCheats();