diff --git a/ai/ai.c b/ai/ai.c index 516a86cc69..c186d8051f 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 36c9deae32..1e2993a21b 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();