Merge tag '14.0-beta2' into jgrpp
# Conflicts: # CMakeLists.txt # src/cargotype.cpp # src/console_cmds.cpp # src/graph_gui.cpp # src/industry_cmd.cpp # src/industrytype.h # src/misc_gui.cpp # src/network/network_client.cpp # src/newgrf.cpp # src/newgrf_town.cpp # src/object_cmd.cpp # src/openttd.cpp # src/pathfinder/water_regions.cpp # src/saveload/saveload.cpp # src/saveload/saveload.h # src/table/build_industry.h # src/table/engines.h # src/vehicle.cpp # src/vehicle_cmd.cpp # src/vehicle_gui.cpp
This commit is contained in:
@@ -163,6 +163,17 @@ struct AIConfigWindow : public Window {
|
||||
switch (widget) {
|
||||
case WID_AIC_LIST: {
|
||||
Rect tr = r.Shrink(WidgetDimensions::scaled.matrix);
|
||||
int max_slot = GetGameSettings().difficulty.max_no_competitors;
|
||||
if (_game_mode == GM_NORMAL) {
|
||||
for (const Company *c : Company::Iterate()) {
|
||||
if (c->is_ai) max_slot--;
|
||||
}
|
||||
for (CompanyID cid = COMPANY_FIRST; cid < (CompanyID)max_slot && cid < MAX_COMPANIES; cid++) {
|
||||
if (Company::IsValidID(cid)) max_slot++;
|
||||
}
|
||||
} else {
|
||||
max_slot++; // Slot 0 is human
|
||||
}
|
||||
for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < MAX_COMPANIES; i++) {
|
||||
StringID text;
|
||||
|
||||
@@ -179,13 +190,6 @@ struct AIConfigWindow : public Window {
|
||||
if (this->selected_slot == i) {
|
||||
tc = TC_WHITE;
|
||||
} else if (IsEditable((CompanyID)i)) {
|
||||
int max_slot = GetGameSettings().difficulty.max_no_competitors;
|
||||
for (const Company *c : Company::Iterate()) {
|
||||
if (c->is_ai) max_slot--;
|
||||
}
|
||||
for (CompanyID cid = COMPANY_FIRST; cid < (CompanyID)max_slot && cid < MAX_COMPANIES; cid++) {
|
||||
if (Company::IsValidHumanID(cid)) max_slot++;
|
||||
}
|
||||
if (i < max_slot) tc = TC_ORANGE;
|
||||
} else if (Company::IsValidAiID(i)) {
|
||||
tc = TC_GREEN;
|
||||
|
Reference in New Issue
Block a user