Codechange: use prefix operator++ for CompanyID iterations

This commit is contained in:
Rubidium
2025-02-10 17:49:30 +01:00
committed by rubidium42
parent b0eb8fe4db
commit 1ffc950e22
12 changed files with 24 additions and 24 deletions
+3 -3
View File
@@ -190,7 +190,7 @@
AI::scanner_info = nullptr;
AI::scanner_library = nullptr;
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; ++c) {
if (_settings_game.ai_config[c] != nullptr) {
delete _settings_game.ai_config[c];
_settings_game.ai_config[c] = nullptr;
@@ -208,7 +208,7 @@
/* Check for both newgame as current game if we can reload the AIInfo inside
* the AIConfig. If not, remove the AI from the list (which will assign
* a random new AI on reload). */
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; ++c) {
if (_settings_game.ai_config[c] != nullptr && _settings_game.ai_config[c]->HasScript()) {
if (!_settings_game.ai_config[c]->ResetInfo(true)) {
Debug(script, 0, "After a reload, the AI by the name '{}' was no longer found, and removed from the list.", _settings_game.ai_config[c]->GetName());
@@ -270,7 +270,7 @@
}
/* Try to send the event to all AIs */
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; ++c) {
if (c != skip_company) AI::NewEvent(c, event);
}
}