summaryrefslogtreecommitdiff
path: root/src/net/ea/charserverhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-19 21:49:38 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-19 21:52:21 +0300
commit10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9 (patch)
tree0bbedbb7883e08901d4a787cac2f2dc6902f1279 /src/net/ea/charserverhandler.cpp
parent7929cda3c6a65f8707b753e7190a4ca89891fd7e (diff)
downloadplus-10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9.tar.gz
plus-10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9.tar.bz2
plus-10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9.tar.xz
plus-10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9.zip
Add limits for creating chars (hair color, hair style, stats).
Diffstat (limited to 'src/net/ea/charserverhandler.cpp')
-rw-r--r--src/net/ea/charserverhandler.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index 0c01959f2..d71236496 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -35,6 +35,8 @@
#include "utils/gettext.h"
+#include "resources/chardb.h"
+
#include "debug.h"
extern Net::CharHandler *charHandler;
@@ -70,7 +72,17 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *window)
const Token &token =
static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
- mCharCreateDialog->setAttributes(attributes, 30, 1, 9);
+ int minStat = CharDB::getMinStat();
+ if (!minStat)
+ minStat = 1;
+ int maxStat = CharDB::getMaxStat();
+ if (!maxStat)
+ maxStat = 9;
+ int sumStat = CharDB::getSumStat();
+ if (!sumStat)
+ sumStat = 30;
+
+ mCharCreateDialog->setAttributes(attributes, sumStat, minStat, maxStat);
mCharCreateDialog->setFixedGender(true, token.sex);
}