Loading

Revision differences

Old revision #pgd6a1c5yNew revision #peogdurqu
  1Index: src/ai/ai_core.cpp  
  2===================================================================  
  3--- src/ai/ai_core.cpp    (revision 27549)  
  4+++ src/ai/ai_core.cpp    (working copy)  
  5@@ -62,6 +62,7 @@  
  6     cur_company.Restore();  
  7   
  8     InvalidateWindowData(WC_AI_DEBUG, 0, -1);  
  9+    DeleteWindowById(WC_AI_SETTINGS, company);  
  10     return;  
  11 }  
  12   
1Index: src/ai/ai_gui.cpp  13Index: src/ai/ai_gui.cpp  
2===================================================================  14===================================================================  
3--- src/ai/ai_gui.cpp    (revision 27548)  3--- src/ai/ai_gui.cpp    (revision 27549)
4+++ src/ai/ai_gui.cpp    (working copy)  16+++ src/ai/ai_gui.cpp    (working copy)  
5@@ -685,7 +685,10 @@  17@@ -311,7 +311,7 @@
   18         this->vscroll = this->GetScrollbar(WID_AIS_SCROLLBAR);
   19         this->FinishInitNested(slot);  // Initializes 'this->line_height' as side effect.
   20 
   21-        this->SetWidgetDisabledState(WID_AIS_RESET, _game_mode != GM_MENU && Company::IsValidID(this->slot));
   22+        this->SetWidgetDisabledState(WID_AIS_RESET, _game_mode != GM_MENU && Company::IsValidAiID(this->slot) && !Company::Get(this->slot)->ai_instance->IsDead());
   23 
   24         this->vscroll->SetCount((int)this->visible_settings.size());
   25     }
   26@@ -375,7 +375,7 @@
   27         for (; this->vscroll->IsVisible(i) && it != visible_settings.end(); i++, it++) {
   28             const ScriptConfigItem &config_item = **it;
   29             int current_value = config->GetSetting((config_item).name);
   30-            bool editable = _game_mode == GM_MENU || ((this->slot != OWNER_DEITY) && !Company::IsValidID(this->slot)) || (config_item.flags & SCRIPTCONFIG_INGAME) != 0;
   31+            bool editable = _game_mode == GM_MENU || ((this->slot != OWNER_DEITY) && !Company::IsValidID(this->slot)) || ((((config_item.flags & SCRIPTCONFIG_INGAME) != 0) || ((this->slot != OWNER_DEITY) && Company::IsValidAiID(this->slot) && Company::Get(this->slot)->ai_instance->IsDead())));
   32 
   33             StringID str;
   34             TextColour colour;
   35@@ -438,7 +438,7 @@
   36                 VisibleSettingsList::const_iterator it = this->visible_settings.begin();
   37                 for (int i = 0; i < num; i++) it++;
   38                 const ScriptConfigItem config_item = **it;
   39-                if (_game_mode == GM_NORMAL && ((this->slot == OWNER_DEITY) || Company::IsValidID(this->slot)) && (config_item.flags & SCRIPTCONFIG_INGAME) == 0) return;
   40+                if (_game_mode == GM_NORMAL && ((this->slot == OWNER_DEITY) || Company::IsValidID(this->slot)) && ((config_item.flags & SCRIPTCONFIG_INGAME) == 0) && Company::IsValidAiID(this->slot) && !Company::Get(this->slot)->ai_instance->IsDead()) return;
   41 
   42                 if (this->clicked_row != num) {
   43                     DeleteChildWindows(WC_QUERY_STRING);
   44@@ -519,7 +519,7 @@
   45                 break;
   46 
   47             case WID_AIS_RESET:
   48-                if (_game_mode == GM_MENU || !Company::IsValidID(this->slot)) {
   49+                if (_game_mode == GM_MENU || !Company::IsValidID(this->slot) || (this->slot != OWNER_DEITY && Company::IsValidAiID(this->slot) && Company::Get(this->slot)->ai_instance->IsDead())) {
   50                     this->ai_config->ResetSettings();
   51                     this->SetDirty();
   52                 }
   53@@ -532,7 +532,7 @@
   54         if (StrEmpty(str)) return;
   55         ScriptConfigItemList::const_iterator it = this->ai_config->GetConfigList()->begin();
   56         for (int i = 0; i < this->clicked_row; i++) it++;
   57-        if (_game_mode == GM_NORMAL && ((this->slot == OWNER_DEITY) || Company::IsValidID(this->slot)) && (it->flags & SCRIPTCONFIG_INGAME) == 0) return;
   58+        if (_game_mode == GM_NORMAL && ((this->slot == OWNER_DEITY) || Company::IsValidID(this->slot)) && ((it->flags & SCRIPTCONFIG_INGAME) == 0) && Company::IsValidAiID(this->slot) && !Company::Get(this->slot)->ai_instance->IsDead()) return;
   59         int32 value = atoi(str);
   60         this->ai_config->SetSetting((*it).name, value);
   61         this->SetDirty();
   62@@ -543,7 +543,7 @@
   63         assert(this->clicked_dropdown);
   64         ScriptConfigItemList::const_iterator it = this->ai_config->GetConfigList()->begin();
   65         for (int i = 0; i < this->clicked_row; i++) it++;
   66-        if (_game_mode == GM_NORMAL && ((this->slot == OWNER_DEITY) || Company::IsValidID(this->slot)) && (it->flags & SCRIPTCONFIG_INGAME) == 0) return;
   67+        if (_game_mode == GM_NORMAL && ((this->slot == OWNER_DEITY) || Company::IsValidID(this->slot)) && ((it->flags & SCRIPTCONFIG_INGAME) == 0) && Company::IsValidAiID(this->slot) && !Company::Get(this->slot)->ai_instance->IsDead()) return;
   68         this->ai_config->SetSetting((*it).name, index);
   69         this->SetDirty();
   70     }
   71@@ -685,7 +685,7 @@
6         EndContainer(),  72         EndContainer(),  
7         NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),  73         NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),  
8             NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP),  74             NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP),  
9-            NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),  75-            NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),  
10+            NWidget(NWID_SELECTION, INVALID_COLOUR, WID_AIC_SELECT_CONFIGURE),  10+            NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_JUST_STRING, STR_AI_DEBUG_SETTINGS_TOOLTIP),
11+                NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),    
12+                NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_SETTINGS), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_DEBUG_SETTINGS, STR_AI_DEBUG_SETTINGS_TOOLTIP),    
13+            EndContainer(),    
14             NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),  77             NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),  
15             EndContainer(),  78             EndContainer(),  
16         NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),  79         NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),  
17@@ -751,6 +754,34 @@  17@@ -751,6 +751,20 @@
18                         break;  81                         break;  
19                 }  82                 }  
20                 break;  83                 break;  
21+            case WID_AIC_CONFIGURE:  84+            case WID_AIC_CONFIGURE:  
22+                switch (selected_slot) {  85+                switch (selected_slot) {  
23+                    case OWNER_DEITY:  86+                    case OWNER_DEITY:  
24+                        SetDParam(0, _game_mode == GM_NORMAL ? IsEditable(this->selected_slot) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE : STR_AI_CONFIG_CONFIGURE);  24+                        SetDParam(0, (_game_mode == GM_NORMAL && IsEditable(selected_slot)) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE);
25+                        break;  88+                        break;  
26+  89+  
27+                    case INVALID_COMPANY:  90+                    case INVALID_COMPANY:  
  
29+                        break;  92+                        break;  
30+  93+  
31+                    default:  94+                    default:  
32+                        SetDParam(0, (_game_mode == GM_NORMAL && IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead()) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE);  32+                        SetDParam(0, (_game_mode != GM_NORMAL || (_game_mode == GM_NORMAL && IsEditable((CompanyID)selected_slot) && (!Company::IsValidID(selected_slot) || Company::IsValidAiID(selected_slot) && Company::Get(selected_slot)->ai_instance->IsDead()))) ? STR_AI_CONFIG_CONFIGURE : STR_AI_DEBUG_SETTINGS);
33+                        break;  96+                        break;  
34+                }  97+                }  
35+            case WID_AIC_SETTINGS:  98         }
36+                switch (selected_slot) {  99     }
37+                    case OWNER_DEITY:  100 
38+                        SetDParam(0, _game_mode == GM_NORMAL ? IsEditable(this->selected_slot) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE : STR_AI_CONFIG_CONFIGURE);  101@@ -779,11 +793,11 @@
39+                        break;  102         if (slot == OWNER_DEITY) return _game_mode != GM_NORMAL || Game::GetInstance() != NULL;
40+  103 
41+                    case INVALID_COMPANY:  104         if (_game_mode != GM_NORMAL) {
42+                        SetDParam(0, STR_AI_DEBUG_SETTINGS);  105-            return slot > 0 && slot <= GetGameSettings().difficulty.max_no_competitors;
43+                        break;  106+            return slot >= 0 && slot <= MAX_COMPANIES - 1;
44+  107         }
45+                    default:  108-        if (Company::IsValidID(slot) || slot < 0) return false;
46+                        SetDParam(0, (_game_mode == GM_NORMAL && IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead()) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE);  109+        if (Company::IsValidHumanID(slot) || slot < 0) return false;
47+                        break;  110 
48+                }  111-        int max_slot = GetGameSettings().difficulty.max_no_competitors;
49         }  112+        int max_slot = MAX_COMPANIES;
50     }  113         for (CompanyID cid = COMPANY_FIRST; cid < (CompanyID)max_slot && cid < MAX_COMPANIES; cid++) {
51   114             if (Company::IsValidHumanID(cid)) max_slot++;
52Index: src/widgets/ai_widget.h  115         }
53===================================================================  116@@ -802,7 +816,7 @@
54--- src/widgets/ai_widget.h    (revision 27548)  117                 }
55+++ src/widgets/ai_widget.h    (working copy)  118 
56@@ -46,7 +46,11 @@  119                 DrawString(r.left + 10, r.right - 10, r.top + WD_MATRIX_TOP, text,
57     WID_AIC_MOVE_UP,          ///< Move up button.  120-                        (this->selected_slot == OWNER_DEITY) ? TC_WHITE : (IsEditable(OWNER_DEITY) ? TC_ORANGE : TC_SILVER));
58     WID_AIC_MOVE_DOWN,        ///< Move down button.  121+                        (this->selected_slot == OWNER_DEITY) ? TC_WHITE : (IsEditable(OWNER_DEITY) ? (_game_mode == GM_NORMAL) ? (Game::GetInstance()->IsDead()) ? TC_RED : TC_GREEN : TC_ORANGE : TC_SILVER));
59     WID_AIC_CHANGE,           ///< Select another AI button.  122 
60-    WID_AIC_CONFIGURE,        ///< Change AI settings button.  123                 break;
61+  124             }
62+    WID_AIC_SELECT_CONFIGURE, ///< Change AI settings button.  125@@ -812,7 +826,7 @@
63+    WID_AIC_CONFIGURE,        ///< Configure button.  126                 for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < MAX_COMPANIES; i++) {
64+    WID_AIC_SETTINGS,         ///< Settings button.  127                     StringID text;
65+  128 
66     WID_AIC_CLOSE,            ///< Close window button.  129-                    if ((_game_mode != GM_NORMAL && i == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(i))) {
67     WID_AIC_TEXTFILE,         ///< Open AI readme, changelog (+1) or license (+2).  130+                    if (_game_mode == GM_NORMAL && Company::IsValidHumanID(i)) {
68     WID_AIC_CONTENT_DOWNLOAD = WID_AIC_TEXTFILE + TFT_END, ///< Download content button. 131                         text = STR_AI_CONFIG_HUMAN_PLAYER;
   132                     } else if (AIConfig::GetConfig((CompanyID)i)->GetInfo() != NULL) {
   133                         SetDParamStr(0, AIConfig::GetConfig((CompanyID)i)->GetInfo()->GetName());
   134@@ -821,7 +835,7 @@
   135                         text = STR_AI_CONFIG_RANDOM_AI;
   136                     }
   137                     DrawString(r.left + 10, r.right - 10, y + WD_MATRIX_TOP, text,
   138-                            (this->selected_slot == i) ? TC_WHITE : (IsEditable((CompanyID)i) ? TC_ORANGE : TC_SILVER));
   139+                            (this->selected_slot == i) ? TC_WHITE : (IsEditable((CompanyID)i) ? Company::IsValidAiID(i) ? Company::Get(i)->ai_instance->IsDead() ? TC_RED : TC_GREEN : TC_ORANGE : TC_SILVER));
   140                     y += this->line_height;
   141                 }
   142                 break;
   143@@ -837,6 +851,12 @@
   144             ShowScriptTextfileWindow((TextfileType)(widget - WID_AIC_TEXTFILE), this->selected_slot);
   145             return;
   146         }
   147+        bool is_orange_slot = IsEditable((CompanyID)(this->selected_slot)) && !Company::IsValidID(this->selected_slot);
   148+        bool is_red_slot = IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && Company::Get(this->selected_slot)->ai_instance->IsDead();
   149+        bool is_orange_slot_above = IsEditable((CompanyID)(this->selected_slot - 1)) && !Company::IsValidID(this->selected_slot - 1);
   150+        bool is_orange_slot_below = IsEditable((CompanyID)(this->selected_slot + 1)) && !Company::IsValidID(this->selected_slot + 1);
   151+        bool is_red_slot_above = IsEditable((CompanyID)(this->selected_slot - 1)) && Company::IsValidID(this->selected_slot - 1) && Company::IsValidAiID(this->selected_slot - 1) && Company::Get(this->selected_slot - 1)->ai_instance->IsDead();
   152+        bool is_red_slot_below = IsEditable((CompanyID)(this->selected_slot + 1)) && Company::IsValidID(this->selected_slot + 1) && Company::IsValidAiID(this->selected_slot + 1) && Company::Get(this->selected_slot + 1)->ai_instance->IsDead();
   153 
   154         switch (widget) {
   155             case WID_AIC_DECREASE:
   156@@ -845,7 +865,7 @@
   157                 if (widget == WID_AIC_DECREASE) {
   158                     new_value = max(0, GetGameSettings().difficulty.max_no_competitors - 1);
   159                 } else {
   160-                    new_value = min(MAX_COMPANIES - 1, GetGameSettings().difficulty.max_no_competitors + 1);
   161+                    new_value = min(MAX_COMPANIES, GetGameSettings().difficulty.max_no_competitors + 1);
   162                 }
   163                 IConsoleSetSetting("difficulty.max_no_competitors", new_value);
   164                 this->InvalidateData();
   165@@ -867,7 +887,7 @@
   166             }
   167 
   168             case WID_AIC_MOVE_UP:
   169-                if (IsEditable(this->selected_slot) && IsEditable((CompanyID)(this->selected_slot - 1))) {
   170+                if ((is_orange_slot || is_red_slot) && (is_orange_slot_above || is_red_slot_above)) {
   171                     Swap(GetGameSettings().ai_config[this->selected_slot], GetGameSettings().ai_config[this->selected_slot - 1]);
   172                     this->selected_slot--;
   173                     this->vscroll->ScrollTowards(this->selected_slot);
   174@@ -876,7 +896,7 @@
   175                 break;
   176 
   177             case WID_AIC_MOVE_DOWN:
   178-                if (IsEditable(this->selected_slot) && IsEditable((CompanyID)(this->selected_slot + 1))) {
   179+                if ((is_orange_slot || is_red_slot) && (is_orange_slot_below || is_red_slot_below)) {
   180                     Swap(GetGameSettings().ai_config[this->selected_slot], GetGameSettings().ai_config[this->selected_slot + 1]);
   181                     this->selected_slot++;
   182                     this->vscroll->ScrollTowards(this->selected_slot);
   183@@ -921,15 +941,23 @@
   184 
   185         if (!gui_scope) return;
   186 
   187+        bool is_gs_slot = this->selected_slot == OWNER_DEITY;
   188+        bool invalid_slot = this->selected_slot == INVALID_COMPANY;
   189+        bool is_green_slot = IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead();
   190+        bool is_silver_slot_above = !IsEditable((CompanyID)(this->selected_slot - 1));
   191+        bool is_silver_slot_below = !IsEditable((CompanyID)(this->selected_slot + 1));
   192+        bool is_green_slot_above = IsEditable((CompanyID)(this->selected_slot - 1)) && Company::IsValidID(this->selected_slot - 1) && Company::IsValidAiID(this->selected_slot - 1) && !Company::Get(this->selected_slot - 1)->ai_instance->IsDead();
   193+        bool is_green_slot_below = IsEditable((CompanyID)(this->selected_slot + 1)) && Company::IsValidID(this->selected_slot + 1) && Company::IsValidAiID(this->selected_slot + 1) && !Company::Get(this->selected_slot + 1)->ai_instance->IsDead();
   194+
   195         this->SetWidgetDisabledState(WID_AIC_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
   196-        this->SetWidgetDisabledState(WID_AIC_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
   197-        this->SetWidgetDisabledState(WID_AIC_CHANGE, (this->selected_slot == OWNER_DEITY && _game_mode == GM_NORMAL) || this->selected_slot == INVALID_COMPANY);
   198-        this->SetWidgetDisabledState(WID_AIC_CONFIGURE, this->selected_slot == INVALID_COMPANY || GetConfig(this->selected_slot)->GetConfigList()->size() == 0);
   199-        this->SetWidgetDisabledState(WID_AIC_MOVE_UP, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot - 1)));
   200-        this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot + 1)));
   201+        this->SetWidgetDisabledState(WID_AIC_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES);
   202+        this->SetWidgetDisabledState(WID_AIC_CHANGE, _game_mode == GM_NORMAL && (is_gs_slot || is_green_slot) || invalid_slot);
   203+        this->SetWidgetDisabledState(WID_AIC_CONFIGURE, invalid_slot || GetConfig(this->selected_slot)->GetConfigList()->size() == 0);
   204+        this->SetWidgetDisabledState(WID_AIC_MOVE_UP, is_gs_slot || invalid_slot || is_green_slot || is_silver_slot_above || is_green_slot_above);
   205+        this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, is_gs_slot || invalid_slot || is_green_slot || is_silver_slot_below || is_green_slot_below);
   206 
   207         for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) {
   208-            this->SetWidgetDisabledState(WID_AIC_TEXTFILE + tft, this->selected_slot == INVALID_COMPANY || (GetConfig(this->selected_slot)->GetTextfile(tft, this->selected_slot) == NULL));
   209+            this->SetWidgetDisabledState(WID_AIC_TEXTFILE + tft, invalid_slot || (GetConfig(this->selected_slot)->GetTextfile(tft, this->selected_slot) == NULL));
   210         }
   211     }
   212 };
   213Index: src/ai/ai_instance.cpp
   214===================================================================
   215--- src/ai/ai_instance.cpp    (revision 27549)
   216+++ src/ai/ai_instance.cpp    (working copy)
   217@@ -81,6 +81,7 @@
   218 
   219 #include "../company_base.h"
   220 #include "../company_func.h"
   221+#include "../window_func.h"
   222 
   223 #include "../safeguards.h"
   224 
   225@@ -214,6 +215,7 @@
   226     ScriptInstance::Died();
   227 
   228     ShowAIDebugWindow(_current_company);
   229+    InvalidateWindowData(WC_GAME_OPTIONS, WN_GAME_OPTIONS_AI);
   230 
   231     const AIInfo *info = AIConfig::GetConfig(_current_company, AIConfig::SSS_FORCE_GAME)->GetInfo();
   232     if (info != NULL) {
   233Index: src/game/game_instance.cpp
   234===================================================================
   235--- src/game/game_instance.cpp    (revision 27549)
   236+++ src/game/game_instance.cpp    (working copy)
   237@@ -85,6 +85,8 @@
   238 #include "../script/api/game/game_waypointlist.hpp.sq"
   239 #include "../script/api/game/game_window.hpp.sq"
   240 
   241+#include "../window_func.h"
   242+
   243 #include "../safeguards.h"
   244 
   245 
   246@@ -232,6 +234,7 @@
   247     ScriptInstance::Died();
   248 
   249     ShowAIDebugWindow(OWNER_DEITY);
   250+    InvalidateWindowData(WC_GAME_OPTIONS, WN_GAME_OPTIONS_AI);
   251 
   252     const GameInfo *info = Game::GetInfo();
   253     if (info != NULL) {
   254Index: src/lang/english.txt
   255===================================================================
   256--- src/lang/english.txt    (revision 27549)
   257+++ src/lang/english.txt    (working copy)
   258@@ -3982,7 +3982,7 @@
   259 STR_AI_CONFIG_CAPTION                                           :{WHITE}AI/Game Script Configuration
   260 STR_AI_CONFIG_GAMELIST_TOOLTIP                                  :{BLACK}The Game Script that will be loaded in the next game
   261 STR_AI_CONFIG_AILIST_TOOLTIP                                    :{BLACK}The AIs that will be loaded in the next game
   262-STR_AI_CONFIG_HUMAN_PLAYER                                      :Human player
   263+STR_AI_CONFIG_HUMAN_PLAYER                                      :Human Company
   264 STR_AI_CONFIG_RANDOM_AI                                         :Random AI
   265 STR_AI_CONFIG_NONE                                              :(none)
   266 
   267Index: src/table/settings.ini
   268===================================================================
   269--- src/table/settings.ini    (revision 27549)
   270+++ src/table/settings.ini    (working copy)
   271@@ -103,7 +103,7 @@
   272 from     = 97
   273 def      = 0
   274 min      = 0
   275-max      = MAX_COMPANIES - 1
   276+max      = MAX_COMPANIES
   277 interval = 1
   278 proc     = MaxNoAIsChange
   279 cat      = SC_BASIC