… | |
… | |
1818 | $map->load; |
1818 | $map->load; |
1819 | $map->load_diag; |
1819 | $map->load_diag; |
1820 | |
1820 | |
1821 | return unless $self->contr->active; |
1821 | return unless $self->contr->active; |
1822 | $self->activate_recursive; |
1822 | $self->activate_recursive; |
|
|
1823 | |
|
|
1824 | local $self->{_prev_pos} = $link_pos; # ugly hack for rent.ext |
1823 | $self->enter_map ($map, $x, $y); |
1825 | $self->enter_map ($map, $x, $y); |
1824 | } |
1826 | } |
1825 | |
1827 | |
1826 | cf::player->attach ( |
1828 | cf::player->attach ( |
1827 | on_logout => sub { |
1829 | on_logout => sub { |
… | |
… | |
1840 | # try to abort aborted map switching on player login :) |
1842 | # try to abort aborted map switching on player login :) |
1841 | # should happen only on crashes |
1843 | # should happen only on crashes |
1842 | if ($pl->ob->{_link_pos}) { |
1844 | if ($pl->ob->{_link_pos}) { |
1843 | $pl->ob->enter_link; |
1845 | $pl->ob->enter_link; |
1844 | (async { |
1846 | (async { |
1845 | # we need this sleep as the login has a concurrent enter_exit running |
|
|
1846 | # and this sleep increases chances of the player not ending up in scorn |
|
|
1847 | $pl->ob->reply (undef, |
1847 | $pl->ob->reply (undef, |
1848 | "There was an internal problem at your last logout, " |
1848 | "There was an internal problem at your last logout, " |
1849 | . "the server will try to bring you to your intended destination in a second.", |
1849 | . "the server will try to bring you to your intended destination in a second.", |
1850 | cf::NDI_RED); |
1850 | cf::NDI_RED); |
|
|
1851 | # we need this sleep as the login has a concurrent enter_exit running |
|
|
1852 | # and this sleep increases chances of the player not ending up in scorn |
1851 | Coro::Timer::sleep 1; |
1853 | Coro::Timer::sleep 1; |
1852 | $pl->ob->leave_link; |
1854 | $pl->ob->leave_link; |
1853 | })->prio (2); |
1855 | })->prio (2); |
1854 | } |
1856 | } |
1855 | }, |
1857 | }, |