0x00430319
| 221 | |
| 222 | // 0x00430319 |
| 223 | void update() |
| 224 | { |
| 225 | if (!SceneManager::isEditorMode() && !Config::get().companyAIDisabled) |
| 226 | { |
| 227 | CompanyId id = CompanyId(ScenarioManager::getScenarioTicks() & 0x0F); |
| 228 | auto company = get(id); |
| 229 | if (company != nullptr && !isPlayerCompany(id) && !company->empty()) |
| 230 | { |
| 231 | // Only the host should update AI, AI will run game commands |
| 232 | // which will be sent to all the clients |
| 233 | if (!SceneManager::isNetworked() || SceneManager::isNetworkHost()) |
| 234 | { |
| 235 | GameCommands::setUpdatingCompanyId(id); |
| 236 | aiThink(id); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | getGameState().produceAICompanyTimeout++; |
| 241 | if (getGameState().produceAICompanyTimeout >= 192) |
| 242 | { |
| 243 | getGameState().produceAICompanyTimeout = 0; |
| 244 | produceCompanies(); |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // 0x00437FB8 |
| 250 | void updateDaily() |
nothing calls this directly
no test coverage detected