From 7975143ff6a344c0af4ace7f530ae02dc94e1a78 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 20 May 2014 21:04:44 +0300 Subject: Move platerdeathlistener into separate file. --- src/net/ea/playerhandler.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/net/ea/playerhandler.cpp') diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 065ac6365..c6080bcee 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -44,6 +44,7 @@ #include "resources/map/map.h" #include "listeners/updatestatuslistener.h" +#include "listeners/playerdeathlistener.h" #include "net/messagein.h" #include "net/net.h" @@ -53,7 +54,6 @@ #include "debug.h" extern OkDialog *weightNotice; -extern OkDialog *deathNotice; extern int weightNoticeTime; // Max. distance we are willing to scroll after a teleport; @@ -73,27 +73,7 @@ namespace } } weightListener; - /** - * Listener used for handling death message. - */ - struct DeathListener final : public ActionListener - { - void action(const ActionEvent &event A_UNUSED) - { - if (Net::getPlayerHandler()) - Net::getPlayerHandler()->respawn(); - deathNotice = nullptr; - - Game::closeDialogs(); - - if (viewport) - viewport->closePopupMenu(); - - NpcDialog::clearDialogs(); - if (player_node) - player_node->respawn(); - } - } deathListener; + PlayerDeathListener deathListener; } // anonymous namespace -- cgit v1.2.3-70-g09d2