summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/char/char.c27
-rw-r--r--src/char_sql/char.c2
-rw-r--r--src/map/itemdb.c4
-rw-r--r--src/map/skill.c2
5 files changed, 22 insertions, 15 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index f1f977491..9bd05d8a3 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/10/12
+ * Fixed wrong index calculation in TXT char creation code (ref: r11410)
+ * Fixed SQL itemdb loading crash on NULL column (ref: 11398) [ultramage]
* Updated the skill_delayfix function to behave as recently discovered by
Tharis: Skills with no delay set will use amotion ONLY if the skill was
instant-casted. [Skotlex]
diff --git a/src/char/char.c b/src/char/char.c
index 37b779f79..5ecbc4f98 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1179,6 +1179,19 @@ int make_new_char(struct char_session_data* sd, char* name_, int str, int agi, i
return -1;
}
+ // Check Authorised letters/symbols in the name of the character
+ if( char_name_option == 1 ) { // only letters/symbols in char_name_letters are authorised
+ for( i = 0; i < NAME_LENGTH && name[i]; i++ )
+ if (strchr(char_name_letters, name[i]) == NULL)
+ return -2;
+ } else
+ if( char_name_option == 2 ) { // letters/symbols in char_name_letters are forbidden
+ for( i = 0; i < NAME_LENGTH && name[i]; i++ )
+ if( strchr(char_name_letters, name[i]) != NULL )
+ return -2;
+ } // else, all letters/symbols are authorised (except control char removed before)
+
+ //FIXME: the code way below actually depends on the value of 'i' that's used here! [ultramage]
for( i = 0; i < char_num; i++ ) {
// check if name doesn't already exist
if ((name_ignoring_case != 0 && strncmp(char_dat[i].status.name, name, NAME_LENGTH) == 0) ||
@@ -1195,18 +1208,6 @@ int make_new_char(struct char_session_data* sd, char* name_, int str, int agi, i
}
}
- // Check Authorised letters/symbols in the name of the character
- if( char_name_option == 1 ) { // only letters/symbols in char_name_letters are authorised
- for( i = 0; i < NAME_LENGTH && name[i]; i++ )
- if (strchr(char_name_letters, name[i]) == NULL)
- return -2;
- } else
- if( char_name_option == 2 ) { // letters/symbols in char_name_letters are forbidden
- for( i = 0; i < NAME_LENGTH && name[i]; i++ )
- if( strchr(char_name_letters, name[i]) != NULL )
- return -2;
- } // else, all letters/symbols are authorised (except control char removed before)
-
//check other inputs
if((char_num >= MAX_CHARS) // slots
|| (hair_style >= 24) // hair style
@@ -3587,7 +3588,7 @@ int parse_char(int fd)
// add new entry to the chars list
ARR_FIND( 0, MAX_CHARS, ch, sd->found_char[ch] == -1 );
if( ch < MAX_CHARS )
- sd->found_char[ch] = i;
+ sd->found_char[ch] = i; // position of the new char in the char_dat[] array
}
RFIFOSKIP(fd,37);
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index a02bc32d9..f3ecdfe43 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -2952,7 +2952,7 @@ int parse_char(int fd)
// add new entry to the chars list
ARR_FIND( 0, MAX_CHARS, ch, sd->found_char[ch] == -1 );
if( ch < MAX_CHARS )
- sd->found_char[ch] = i;
+ sd->found_char[ch] = i; // the char_id of the new char
}
RFIFOSKIP(fd,37);
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 70a056292..99e74cbbe 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -929,10 +929,14 @@ static int itemdb_read_sqldb(void)
while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) )
{// wrap the result into a TXT-compatible format
char* str[22];
+ char* dummy = "";
int i;
++lines;
for( i = 0; i < 22; ++i )
+ {
Sql_GetData(mmysql_handle, i, &str[i], NULL);
+ if( str[i] == NULL ) str[i] = dummy; // get rid of NULL columns
+ }
if (!itemdb_parse_dbrow(str, item_db_name[fi], lines, 0))
continue;
diff --git a/src/map/skill.c b/src/map/skill.c
index 4f500a2ba..ee9cffcb7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8865,7 +8865,7 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv, bool inst
if (bl->type&battle_config.no_skill_delay)
return battle_config.min_skill_delay_limit;
- // instant delay skills have aspd delay IF they were also instant cast (reported by Tharis) [Skotlex]
+ // no-delay skills get aspd delay IF they were also instant cast (reported by Tharis) [Skotlex]
if (time == 0) {
if (instantcast)
time = status_get_amotion(bl); //Use attack delay.