| 409 | #endif |
| 410 | |
| 411 | void World::PerformAI(float deltaT, float noAccDeltaT) |
| 412 | { |
| 413 | auto& input = InputSubsystem::Instance(); |
| 414 | #if _ENABLE_CHEATS |
| 415 | if (input.GetCheat2ToDo(SDL_SCANCODE_T)) |
| 416 | { |
| 417 | disableAI = !disableAI; |
| 418 | GlobalShowMessage(500, "Group AI %s", disableAI ? "Off" : "On"); |
| 419 | } |
| 420 | if (input.GetCheat2ToDo(SDL_SCANCODE_U)) |
| 421 | { |
| 422 | disableUnitAI = !disableUnitAI; |
| 423 | GlobalShowMessage(500, "Unit AI %s", disableUnitAI ? "Off" : "On"); |
| 424 | } |
| 425 | if (input.GetCheat2ToDo(SDL_SCANCODE_I)) |
| 426 | { |
| 427 | disableSimpleSim = !disableSimpleSim; |
| 428 | GlobalShowMessage(500, "Simple sim %s", disableSimpleSim ? "Off" : "On"); |
| 429 | } |
| 430 | #endif |
| 431 | if (deltaT > 0 |
| 432 | #if _ENABLE_CHEATS |
| 433 | && !disableAI |
| 434 | #endif |
| 435 | ) |
| 436 | { |
| 437 | GetRadio().Simulate(deltaT); |
| 438 | if (_eastCenter) |
| 439 | { |
| 440 | _eastCenter->GetRadio().Simulate(deltaT); |
| 441 | _eastCenter->Think(); |
| 442 | int i; |
| 443 | for (i = 0; i < _eastCenter->NGroups(); i++) |
| 444 | { |
| 445 | AIGroup* grp = _eastCenter->GetGroup(i); |
| 446 | if (grp) |
| 447 | { |
| 448 | grp->GetRadio().Simulate(deltaT); |
| 449 | } |
| 450 | } |
| 451 | } |
| 452 | if (_westCenter) |
| 453 | { |
| 454 | _westCenter->GetRadio().Simulate(deltaT); |
| 455 | _westCenter->Think(); |
| 456 | int i; |
| 457 | for (i = 0; i < _westCenter->NGroups(); i++) |
| 458 | { |
| 459 | AIGroup* grp = _westCenter->GetGroup(i); |
| 460 | if (grp) |
| 461 | { |
| 462 | grp->GetRadio().Simulate(deltaT); |
| 463 | } |
| 464 | } |
| 465 | } |
| 466 | if (_guerrilaCenter) |
| 467 | { |
| 468 | _guerrilaCenter->GetRadio().Simulate(deltaT); |
nothing calls this directly
no test coverage detected