| 576 | } |
| 577 | |
| 578 | AsyncOp Game_Event::Update(bool resume_async) { |
| 579 | if (!data()->active || (!resume_async && page == NULL)) { |
| 580 | return {}; |
| 581 | } |
| 582 | |
| 583 | // RPG_RT runs the parallel interpreter everytime Update is called. |
| 584 | // That means if the event updates multiple times due to makeway, |
| 585 | // the interpreter will run multiple times per frame. |
| 586 | // This results in event waits to finish quicker during collisions as |
| 587 | // the wait will tick by 1 each time the interpreter is invoked. |
| 588 | if ((resume_async || GetTrigger() == lcf::rpg::EventPage::Trigger_parallel) && interpreter) { |
| 589 | if (!interpreter->IsRunning() && page && !page->event_commands.empty()) { |
| 590 | interpreter->Push(this); |
| 591 | } |
| 592 | interpreter->Update(!resume_async); |
| 593 | |
| 594 | // Suspend due to async op ... |
| 595 | if (interpreter->IsAsyncPending()) { |
| 596 | return interpreter->GetAsyncOp(); |
| 597 | } |
| 598 | |
| 599 | // RPG_RT only exits if active is false here, but not if there is |
| 600 | // no active page... |
| 601 | if (!data()->active) { |
| 602 | return {}; |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | Game_Character::Update(); |
| 607 | |
| 608 | return {}; |
| 609 | } |
| 610 | |
| 611 | const lcf::rpg::EventPage* Game_Event::GetPage(int page) const { |
| 612 | if (page <= 0 || page - 1 >= static_cast<int>(event->pages.size())) { |
nothing calls this directly
no test coverage detected