From 10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Nov 2011 21:49:38 +0300 Subject: Add limits for creating chars (hair color, hair style, stats). --- src/net/ea/charserverhandler.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/net/ea') 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(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); } -- cgit v1.2.3-70-g09d2