summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c18
-rw-r--r--src/char_sql/int_guild.c2
2 files changed, 10 insertions, 10 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);
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 4ad3ea070..9b29befb3 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -31,7 +31,7 @@
#define GUILD_ALLIANCE_TYPE_MASK 0x01
#define GUILD_ALLIANCE_REMOVE 0x08
-static char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+static const char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
#ifndef TXT_SQL_CONVERT
//Guild cache