summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-21 14:52:23 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-21 14:52:23 +0000
commiteb3546a33a9689a745e6497fc9e781f4e7f9b3c1 (patch)
tree27d1ce4e1aab84a20c171ba4bc33b47baf227dfc /src/char_sql/char.c
parente85f5bc390679728f16264908755a5b594055f8b (diff)
downloadhercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.tar.gz
hercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.tar.bz2
hercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.tar.xz
hercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.zip
- Added define MAX_CHARS so you can easily mod the server to support a different amount of characters per account (however, there is still the issue of hexing the client to support this change)
- Updated msg_athena.conf so it no longer uses broken english on several entries. Thanks to Scerez for the updated file. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10044 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index afc65c677..4f9ef962f 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -128,7 +128,7 @@ static int online_check = 1; //If one, it won't let players connect when their a
struct char_session_data{
int account_id, login_id1, login_id2,sex;
- int found_char[9];
+ int found_char[MAX_CHARS];
char email[40]; // e-mail (default: a@a.com) by [Yor]
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
};
@@ -1298,7 +1298,7 @@ int make_new_char_sql(int fd, unsigned char *dat) {
//check stat error
if ((dat[24]+dat[25]+dat[26]+dat[27]+dat[28]+dat[29]!=6*5 ) || // stats
- (dat[30] >= 9) || // slots (dat[30] can not be negativ)
+ (dat[30] >= MAX_CHARS) || // slots (dat[30] can not be negativ)
(dat[33] <= 0) || (dat[33] >= 24) || // hair style
(dat[31] >= 9)) { // hair color (dat[31] can not be negativ)
if (log_char) {
@@ -1746,7 +1746,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
set_char_online(-1, 99,sd->account_id);
//search char.
- sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_num` < '9'",char_db, sd->account_id);
+ sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_num` < '%d'",char_db, sd->account_id, MAX_CHARS);
if (mysql_query(&mysql_handle, tmp_sql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
@@ -1763,7 +1763,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
mysql_free_result(sql_res);
}
- for(i = found_num; i < 9; i++)
+ for(i = found_num; i < MAX_CHARS; i++)
sd->found_char[i] = -1;
if (save_log)
@@ -3442,7 +3442,7 @@ int parse_char(int fd) {
RFIFOSKIP(fd, 37);
}
//to do
- for(ch = 0; ch < 9; ch++) {
+ for(ch = 0; ch < MAX_CHARS; ch++) {
if (sd->found_char[ch] == -1) {
sd->found_char[ch] = char_dat.char_id;
break;
@@ -3470,17 +3470,17 @@ int parse_char(int fd) {
break;
}
- for(i = 0; i < 9; i++) {
+ for(i = 0; i < MAX_CHARS; i++) {
if (sd->found_char[i] == cid) {
- for(ch = i; ch < 9-1; ch++)
+ for(ch = i; ch < MAX_CHARS-1; ch++)
sd->found_char[ch] = sd->found_char[ch+1];
- sd->found_char[8] = -1;
+ sd->found_char[MAX_CHARS-1] = -1;
break;
}
}
/* Such a character does not exist in the account */
/* If so, you are so screwed. */
- if (i == 9) {
+ if (i == MAX_CHARS) {
WFIFOW(fd, 0) = 0x70;
WFIFOB(fd, 2) = 0;
WFIFOSET(fd, 3);