summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-04 09:43:31 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-04 09:43:31 +0000
commita3f8ecfcc0ed3f6bf487fcba6dd832e4c697c9c7 (patch)
treea395fb6a2de62c01b0749eb1f769945c1e507efc /src/map
parent87689fc8de53744d07fed292831e7b93eb24ed51 (diff)
downloadhercules-a3f8ecfcc0ed3f6bf487fcba6dd832e4c697c9c7.tar.gz
hercules-a3f8ecfcc0ed3f6bf487fcba6dd832e4c697c9c7.tar.bz2
hercules-a3f8ecfcc0ed3f6bf487fcba6dd832e4c697c9c7.tar.xz
hercules-a3f8ecfcc0ed3f6bf487fcba6dd832e4c697c9c7.zip
- Fixed feature.conf improper formatting and removed two unnecessary iterations (follow-up to r16071)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16076 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 741513ca2..24a453cce 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8780,36 +8780,15 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
else
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)) {
- 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;
++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) == 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) )
- {
+ 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;
}