summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-02-11 20:00:09 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-02-11 20:00:09 +0100
commit599642b57e65d5b515fd748a0f71bc7e03723b05 (patch)
tree93fe70adf6c190983a4f40de4d3ca00bd63106cb /src
parentafe3490781c1d35e452a52a53988526b72cea61e (diff)
downloadmanaserv-599642b57e65d5b515fd748a0f71bc7e03723b05.tar.gz
manaserv-599642b57e65d5b515fd748a0f71bc7e03723b05.tar.bz2
manaserv-599642b57e65d5b515fd748a0f71bc7e03723b05.tar.xz
manaserv-599642b57e65d5b515fd748a0f71bc7e03723b05.zip
Fix the GP base and mod values for newly created characters.
Reviewed-by: Freeyorp.
Diffstat (limited to 'src')
-rw-r--r--src/account-server/accounthandler.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 5cb71c4d..79415bd7 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -802,6 +802,17 @@ void AccountHandler::handleCharacterCreateMessage(AccountClient &client,
newCharacter->setAccount(acc);
newCharacter->setCharacterSlot(slot);
newCharacter->setLevel(1);
+
+ // Init GP value to avoid flawed ones.
+ AttributeMap::iterator itr =
+ newCharacter->mAttributes.find(ATTR_GP);
+ // Set up the base and modified attribute to 0.
+ if (itr != newCharacter->mAttributes.end())
+ {
+ itr->second.first = 0;
+ itr->second.second = 0;
+ }
+
newCharacter->setCharacterPoints(0);
newCharacter->setCorrectionPoints(0);
newCharacter->setGender(gender);