(svn r13454) [NoAI] -Fix: kill all AIs when leaving game in any way (restart, loadgame, ..) (tnx Yexo for reporting, and glx for fixing) noai
authortruebrain
Tue, 10 Jun 2008 21:30:41 +0000
branchnoai
changeset 10903 970651c2e670
parent 10902 57b380ee1607
child 10904 3070af6d1d25
(svn r13454) [NoAI] -Fix: kill all AIs when leaving game in any way (restart, loadgame, ..) (tnx Yexo for reporting, and glx for fixing)
src/openttd.cpp
--- a/src/openttd.cpp	Tue Jun 10 21:00:02 2008 +0000
+++ b/src/openttd.cpp	Tue Jun 10 21:30:41 2008 +0000
@@ -865,6 +865,8 @@
 		}
 	}
 #endif /* ENABLE_NETWORK */
+	/* Make sure all AI controllers are gone at quiting game */
+	if (new_mode != SM_SAVE) AI_KillAll();
 
 	switch (new_mode) {
 		case SM_EDITOR: /* Switch to scenario editor */
@@ -943,7 +945,6 @@
 		}
 
 		case SM_MENU: /* Switch to game intro menu */
-			AI_KillAll();
 			LoadIntroGame();
 			break;