MCPcopy Create free account
hub / github.com/EasyRPG/Player / FinishPendingTeleport2

Method FinishPendingTeleport2

src/scene_map.cpp:331–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void Scene_Map::FinishPendingTeleport2(MapUpdateAsyncContext actx, TeleportParams tp) {
332 PreUpdate(actx);
333
334 if (actx.IsActive()) {
335 OnAsyncSuspend([=] { FinishPendingTeleport2(actx, tp); }, actx.GetAsyncOp(), true);
336 return;
337 }
338
339 if (!tp.defer_recursive_teleports) {
340 // RPG_RT behavior - Escape and Teleport skills silently ignore any teleport commands
341 // executed by events during pre-update frame and defer them until first frame.
342 if (Main_Data::game_player->IsPendingTeleport()) {
343 tp.erase_screen = false;
344 StartPendingTeleport(tp);
345 return;
346 }
347 }
348
349 auto& transition = Transition::instance();
350
351 // This logic was tested against RPG_RT and works this way ...
352 if (tp.use_default_transition_in && transition.IsErasedNotActive()) {
353 transition.InitShow(Transition::TransitionFadeIn, this);
354 } else if (!tp.use_default_transition_in && !screen_erased_by_event) {
355 transition.InitShow(Main_Data::game_system->GetTransition(Main_Data::game_system->Transition_TeleportShow), this);
356 }
357
358 // Call any requested scenes when transition is done.
359 AsyncNext([=]() { FinishPendingTeleport3(actx, tp); });
360}
361
362void Scene_Map::FinishPendingTeleport3(MapUpdateAsyncContext actx, TeleportParams tp) {
363 if (tp.run_foreground_events) {

Callers

nothing calls this directly

Calls 6

IsPendingTeleportMethod · 0.80
IsErasedNotActiveMethod · 0.80
InitShowMethod · 0.80
GetTransitionMethod · 0.80
IsActiveMethod · 0.45
GetAsyncOpMethod · 0.45

Tested by

no test coverage detected