summaryrefslogtreecommitdiff
path: root/src/net/tmwa/charserverhandler.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-05-02 10:10:37 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-05-02 10:11:19 +0200
commit679d830d0ba6ecbcd698b1ff2625144d08314b9e (patch)
tree24e5c1ea5fa6f11165d726cd345726fd3dae8fdd /src/net/tmwa/charserverhandler.cpp
parent35108f09f64835a8d02c5bfb2ec62426ab83bd59 (diff)
parenta6b11834f227b8edbfb39633380806480fd2a2c5 (diff)
downloadmana-client-679d830d0ba6ecbcd698b1ff2625144d08314b9e.tar.gz
mana-client-679d830d0ba6ecbcd698b1ff2625144d08314b9e.tar.bz2
mana-client-679d830d0ba6ecbcd698b1ff2625144d08314b9e.tar.xz
mana-client-679d830d0ba6ecbcd698b1ff2625144d08314b9e.zip
Merge branch 'master' into lpc2012
This merge reverts change 3b22c2cf170c877904dcef5a4af03ac360bd0581. Conflicts: src/gui/charcreatedialog.cpp src/net/manaserv/manaserv_protocol.h
Diffstat (limited to 'src/net/tmwa/charserverhandler.cpp')
-rw-r--r--src/net/tmwa/charserverhandler.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index ce193821..7c5f5c88 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -38,6 +38,8 @@
#include "net/tmwa/network.h"
#include "net/tmwa/protocol.h"
+#include "resources/attributes.h"
+#include "resources/chardb.h"
#include "resources/hairdb.h"
#include "utils/dtor.h"
@@ -278,7 +280,17 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *window)
const Token &token =
static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
- mCharCreateDialog->setAttributes(attributes, 30, 1, 9);
+ unsigned minStat = CharDB::getMinStat();
+ if (minStat == 0)
+ minStat = Attributes::getAttributeMinimum();
+ unsigned maxStat = CharDB::getMaxStat();
+ if (maxStat == 0)
+ maxStat = Attributes::getAttributeMaximum();
+ unsigned sumStat = CharDB::getSumStat();
+ if (sumStat == 0)
+ sumStat = Attributes::getCreationPoints();
+
+ mCharCreateDialog->setAttributes(attributes, sumStat, minStat, maxStat);
mCharCreateDialog->setFixedGender(true, token.sex);
}
@@ -342,6 +354,18 @@ unsigned int CharServerHandler::maxSprite() const
return SPRITE_VECTOREND;
}
+int CharServerHandler::getCharCreateMaxHairColorId() const
+{
+ const int max = CharDB::getMaxHairColor();
+ return max ? max : 11; // default maximum
+}
+
+int CharServerHandler::getCharCreateMaxHairStyleId() const
+{
+ const int max = CharDB::getMaxHairStyle();
+ return max ? max : 19; // default maximum
+}
+
void CharServerHandler::connect()
{
const Token &token =