From c19903f2726d0132323bb66237c2e88dc7aa0f62 Mon Sep 17 00:00:00 2001 From: ultramage Date: Mon, 30 Mar 2009 10:18:25 +0000 Subject: Fixed atcommand_param() using a hardcoded @ symbol, which broke on charcommands and changed atcommand_symbol (bugreport:2918). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13642 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 1ed4f0701..591a8ca8e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2936,7 +2936,7 @@ int atcommand_zeny(const int fd, struct map_session_data* sd, const char* comman int atcommand_param(const int fd, struct map_session_data* sd, const char* command, const char* message) { int i, value = 0, new_value, max; - const char* param[] = { "@str", "@agi", "@vit", "@int", "@dex", "@luk", NULL }; + const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" }; short* status[6]; //we don't use direct initialization because it isn't part of the c standard. nullpo_retr(-1, sd); @@ -2949,11 +2949,9 @@ int atcommand_param(const int fd, struct map_session_data* sd, const char* comma return -1; } - for (i = 0; param[i] != NULL; i++) - if (strcmpi(command, param[i]) == 0) - break; + ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 ); - if (param[i] == NULL || i > MAX_STATUS_TYPE) { // normally impossible... + if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible... sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustment>)."); clif_displaymessage(fd, atcmd_output); return -1; -- cgit v1.2.3-70-g09d2