- Fixed feature.conf improper formatting and removed two unnecessary iterations (follow-up to r16071)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16076 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
epoque11 2012-05-04 09:43:31 +00:00
parent 710849412d
commit ee483eea0e
2 changed files with 3 additions and 24 deletions

View File

@ -17,4 +17,4 @@ feature.search_stores: on
// Atcommand suggestions (Note 1) // Atcommand suggestions (Note 1)
// If one type incomplete atcommand, it will suggest the complete ones. // If one type incomplete atcommand, it will suggest the complete ones.
feature.atcommand_suggestions = off feature.atcommand_suggestions: off

View File

@ -8780,36 +8780,15 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
else else
type = COMMAND_CHARCOMMAND; type = COMMAND_CHARCOMMAND;
// First match the beginnings of the commands
for (command_info = dbi_first(atcommand_iter); dbi_exists(atcommand_iter) && count < MAX_SUGGESTIONS; command_info = dbi_next(atcommand_iter)) { for (command_info = dbi_first(atcommand_iter); dbi_exists(atcommand_iter) && count < MAX_SUGGESTIONS; command_info = dbi_next(atcommand_iter)) {
if ( strstr(command_info->command, name) == command_info->command && pc_can_use_command(sd, command_info->command, type) ) if ( stristr(command_info->command, name) == command_info->command && pc_can_use_command(sd, command_info->command, type) ) {
{
suggestions[count] = command_info->command; suggestions[count] = command_info->command;
++count; ++count;
} }
} }
for (alias_info = dbi_first(alias_iter); dbi_exists(alias_iter) && count < MAX_SUGGESTIONS; alias_info = dbi_next(alias_iter)) { for (alias_info = dbi_first(alias_iter); dbi_exists(alias_iter) && count < MAX_SUGGESTIONS; alias_info = dbi_next(alias_iter)) {
if ( strstr(alias_info->alias, name) == alias_info->alias && pc_can_use_command(sd, alias_info->command->command, type) ) if ( stristr(alias_info->alias, name) == alias_info->alias && pc_can_use_command(sd, alias_info->command->command, type) ) {
{
suggestions[count] = alias_info->alias;
++count;
}
}
// Fill up the space left, with full matches
for (command_info = dbi_first(atcommand_iter); dbi_exists(atcommand_iter) && count < MAX_SUGGESTIONS; command_info = dbi_next(atcommand_iter)) {
if ( strstr(command_info->command, name) != NULL && pc_can_use_command(sd, command_info->command, type) )
{
suggestions[count] = command_info->command;
++count;
}
}
for (alias_info = dbi_first(alias_iter); dbi_exists(alias_iter) && count < MAX_SUGGESTIONS; alias_info = dbi_next(alias_iter)) {
if ( strstr(alias_info->alias, name) != NULL && pc_can_use_command(sd, alias_info->command->command, type) )
{
suggestions[count] = alias_info->alias; suggestions[count] = alias_info->alias;
++count; ++count;
} }