summaryrefslogtreecommitdiff
path: root/src/accounthandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/accounthandler.cpp')
-rw-r--r--src/accounthandler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/accounthandler.cpp b/src/accounthandler.cpp
index 59956242..2934afde 100644
--- a/src/accounthandler.cpp
+++ b/src/accounthandler.cpp
@@ -132,6 +132,8 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
result.writeShort(SMSG_CHAR_CREATE_RESPONSE);
result.writeByte(CREATE_OK);
+
+ store.flush(); // flush changes
}
break;
@@ -140,7 +142,7 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
if (computer.getAccount() == NULL)
break; // not logged in
- char charNum = message.readByte();
+ unsigned char charNum = message.readByte();
tmwserv::Beings &chars = computer.getAccount()->getCharacters();
@@ -150,6 +152,8 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
result.writeByte(SELECT_INVALID);
break;
}
+
+ computer.setCharacter(chars[charNum].get());
result.writeByte(SELECT_OK);
}