(svn r12927) [NoAI] -Fix: don't crash on the GUI when an AI failed to compile and you still manual it (bug by glx) noai
authortruebrain
Tue, 29 Apr 2008 22:02:38 +0000
branchnoai
changeset 10385 4547ef131005
parent 10384 f0106eb03df3
child 10386 f6ce140b5ffd
(svn r12927) [NoAI] -Fix: don't crash on the GUI when an AI failed to compile and you still manual it (bug by glx)
src/ai/ai_gui.cpp
--- a/src/ai/ai_gui.cpp	Tue Apr 29 21:49:14 2008 +0000
+++ b/src/ai/ai_gui.cpp	Tue Apr 29 22:02:38 2008 +0000
@@ -115,7 +115,12 @@
 			}
 
 			AIFactoryBase *factory = AI_GetPlayerFactory(_ai_debug_player);
-			DoDrawString(factory->GetAIName(), 7, 34, TC_BLACK);
+			if (factory == NULL) {
+				DoDrawString("(unknown)", 7, 34, TC_BLACK);
+				w->DisableWidget(AID_WIDGET_RELOAD_TOGGLE);
+			} else {
+				DoDrawString(factory->GetAIName(), 7, 34, TC_BLACK);
+			}
 
 			PlayerID old_cp = _current_player;
 			_current_player = _ai_debug_player;