diff options
Diffstat (limited to 'src/net/tmwserv')
-rw-r--r-- | src/net/tmwserv/charhandler.cpp | 11 | ||||
-rw-r--r-- | src/net/tmwserv/charhandler.h | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/net/tmwserv/charhandler.cpp b/src/net/tmwserv/charhandler.cpp index 841c9a2d..03a6dff0 100644 --- a/src/net/tmwserv/charhandler.cpp +++ b/src/net/tmwserv/charhandler.cpp @@ -100,10 +100,13 @@ void CharHandler::handleMessage(MessageIn &msg) // Character deletion successful if (errMsg == ERRMSG_OK) { - delete mCharInfo->getEntry(); + LocalPlayer *tempPlayer = mCharInfo->getEntry(); mCharInfo->setEntry(0); mCharInfo->unlock(); + if (mCharSelectDialog) + mCharSelectDialog->update(mCharInfo->getPos()); new OkDialog(_("Info"), _("Player deleted.")); + delete tempPlayer; } // Character deletion failed else @@ -291,9 +294,13 @@ void CharHandler::handleCharSelectResponse(MessageIn &msg) } } +void CharHandler::setCharSelectDialog(CharSelectDialog *window) +{ + mCharSelectDialog = window; +} + void CharHandler::setCharCreateDialog(CharCreateDialog *window) { - mCharSelectDialog = window ? window->getSelectDialog() : NULL; mCharCreateDialog = window; if (!mCharCreateDialog) return; diff --git a/src/net/tmwserv/charhandler.h b/src/net/tmwserv/charhandler.h index 5517bd17..03ea51dc 100644 --- a/src/net/tmwserv/charhandler.h +++ b/src/net/tmwserv/charhandler.h @@ -47,6 +47,8 @@ class CharHandler : public MessageHandler, public Net::CharHandler mCharInfo = charInfo; } + void setCharSelectDialog(CharSelectDialog *window); + /** * Sets the character create dialog. The handler will clean up this * dialog when a new character is succesfully created, and will unlock |