summaryrefslogtreecommitdiff
path: root/src/net/tmwa/charserverhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/charserverhandler.cpp')
-rw-r--r--src/net/tmwa/charserverhandler.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 4167a3620..3fed3b568 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -94,10 +94,13 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
break;
case SMSG_CHAR_CREATE_SUCCEEDED:
- case SMSG_CHAR_CREATE_SUCCEEDED2:
processCharCreate(msg);
break;
+ case SMSG_CHAR_CREATE_SUCCEEDED2:
+ processCharCreate2(msg);
+ break;
+
case SMSG_CHAR_CREATE_FAILED:
processCharCreateFailed(msg);
break;
@@ -435,7 +438,7 @@ void CharServerHandler::processCharCreate(Net::MessageIn &msg)
{
BLOCK_START("CharServerHandler::processCharCreate")
Net::Character *const character = new Net::Character;
- readPlayerData(msg, character, msg.getId() == SMSG_CHAR_CREATE_SUCCEEDED2);
+ readPlayerData(msg, character, false);
mCharacters.push_back(character);
updateCharSelectDialog();
@@ -449,4 +452,22 @@ void CharServerHandler::processCharCreate(Net::MessageIn &msg)
BLOCK_END("CharServerHandler::processCharCreate")
}
+void CharServerHandler::processCharCreate2(Net::MessageIn &msg)
+{
+ BLOCK_START("CharServerHandler::processCharCreate2")
+ Net::Character *const character = new Net::Character;
+ readPlayerData(msg, character, true);
+ mCharacters.push_back(character);
+
+ updateCharSelectDialog();
+
+ // Close the character create dialog
+ if (mCharCreateDialog)
+ {
+ mCharCreateDialog->scheduleDelete();
+ mCharCreateDialog = nullptr;
+ }
+ BLOCK_END("CharServerHandler::processCharCreate2")
+}
+
} // namespace TmwAthena